Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino R3 is incapable of running current Fuzzy Logic code #305

Closed
RobertLRead opened this issue Aug 10, 2024 · 4 comments
Closed

Arduino R3 is incapable of running current Fuzzy Logic code #305

RobertLRead opened this issue Aug 10, 2024 · 4 comments
Assignees
Labels
bug Something isn't working firmware

Comments

@RobertLRead
Copy link
Contributor

Probably because of memory.

It is very clear that just by uncommenting certain code, which is not executed until AFTER the OLED is initiated, we can prevent the OLED from initiating. This is code that allocates the "Fuzzy" objects.

I conclude that the Fuzzy logic will run on an R4, but not on an R3.

However, that analog temperature read basically doesn't work on an R4. (It is not clear to me that it works on an R3.)

So we are stuck. I am going to implement a PID controller on an R3; I believe there is a high probability that that will work, but I will check all the hardware features (esp. the temperature read) first.

@ForrestErickson
Copy link
Collaborator

ForrestErickson commented Aug 11, 2024

Lee experimenting with Wokwi simulating the MoonRatIi on an R3

See: https://wokwi.com/projects/405744143993619457

I am worried I am not using the same code as is Robert.

Simulation Compiles with Fuzzy Logic, OLED begin error.

At run time I get an error "Error while initializing OLED"
Screen shot
image

Notes on code changes to R3

In the code I have:

changed within the code the #define for R3

// Set controller type here
#define R3 //Uncomment for Arduino UNO R3
//#define R4 //Uncomment for Arduino UNO R4>

When I do so the code compiles so I conclude that running the Fuzzy Logic code is possible.

I have compared and contrasted the code which I believe to be initializing the OLED and do not find differences against examples which compile and run.
Here is one such example: https://wokwi.com/projects/405917918926102529

Because I saw it in other code examples I found, I added the line: "#include <SPI.h>"

in Setup(), I have commented out some IO pin initialization for heater and buzzer that was before the OLED setup.

However, the run time "Error while initializing OLED" remains.

@melanielaporte
Copy link
Collaborator

We are no longer using the R3 and have moved to the R4.

@ForrestErickson
Copy link
Collaborator

ForrestErickson commented Oct 31, 2024

Reopening and Trying to Duplicate Problem in Maryville

Journal of Testing

Lee has installed the eFILL library
image

Lee has found example codes from the eFILL library
image

Lee has set the IDE for UNO and opened and compiled the example code from the eFILL library
image

The compiler reports:

Sketch uses 11482 bytes (35%) of program storage space. Maximum is 32256 bytes.
Global variables use 264 bytes (12%) of dynamic memory, leaving 1784 bytes for local variables. Maximum is 2048 bytes.

Load and Run

Lee loaded the code into an R3 and ran it.
image

Conclusion

Lee is unable to duplicate the problem "Arduino R3 is incapable of running current Fuzzy Logic code".
Their may be insufficient description of the setup where Robert (and others?) had the error.

CC:
@melanielaporte

@RobertLRead
Copy link
Contributor Author

Lee is right. I have tried to compile both Horacios most recent code and mine, and both seem to load into the R3.

I can't explain if my creation of this issue was in error was based on some legitimate reason that I have forgotten. I am closing this issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working firmware
Projects
None yet
Development

No branches or pull requests

3 participants