¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Re: freeMemory()


 

OK,? I'm? **so** dumb I had to drop back to his EARLIER video for beginners but I have a graphical version of git now running on my windows computer.? ?Made it through 3 minutes of the first video.? ?Probalbyl going to quit for lunch soon and come back.? ?I'll get this figured out!

Next goal is some sort of functional test of both Marcelo and "simple" code today.? ?I want to give Marcelo a written list of what I see and also evaluate "simple" code.??

Jack -- My choice of the FCN button to initiate the two-button sequences was poor.? Because if you don't play piano well, you often end up just getting an 8 second vent-pause and recalibrate.? ?Can youo do that better?? ?Perhaps use a different button as the 1st button of the sequence????? Or you and Ashhar do something even much better?? ?

We need additional inputs now
ASSIST ON
ASSIST OFF
need to exist within the user-nterface?with the buttons.? ?A two-button sequence starting with another different button is possible, or holding a button, --- whatever you wish.? ? I just did the 2-buttons because I was capable of programming that.

I think we are very close to the LAST of the features on the 2-line display.? ?For anything more than that, we'll need a 4 line display.? ?I have one, and hope to have it working by tomorrow morning......on something.? ??

But for now I'll work on the github education.?


Gordon


On Thu, Apr 16, 2020 at 11:07 AM Ashhar Farhan <farhanbox@...> wrote:
I suggest that we immediately start using github. It is the only way to NOT wait for each other to finish the code.
Take a break for 20 minutes and watch this


On Thu 16 Apr, 2020, 8:15 PM jjpurdum via , <jjpurdum=[email protected]> wrote:
Gordon:

Add this line to line 73 in vent.h

??? extern char *__brkval;????????// leading double-underscore to prevent name collisions

and around line 139 in the same file, insert:

??? int freeMemory();???????????? // Function prototype

Add this line around line 101 in the INO file:

????char *__brkval;

Finally, add this function block to the INO file around line 179:

/
?? Purpose: To measure the runtime amount of SRAM memory available at the point where called

?? Parameter list:
??????? void

?? Return value:
??????? int??????? the amount of remaining free SRAM at the point called

?? CAUTION: ?????? Function assumes that Arduino.h is #include'd in the project
/
int freeMemory()
{
? char top;

? return __brkval ? &top - __brkval : &top - __malloc_heap_start;
}

When you wish to measure SRAM at a point in the program, insert:

? Serial.print("============ free memory: ");
? Serial.println(freeMemory());

I cannot test it on the vent code because of the runtime test for the pressure sensor, which hangs my system.
Let me know if it doesn't work.

Jack, W8TEE

Join [email protected] to automatically receive all group messages.