Skip to content

Instantly share code, notes, and snippets.

@StuffAndyMakes
Created May 22, 2015 16:02
Show Gist options
  • Save StuffAndyMakes/8aeb195539c530d53ca2 to your computer and use it in GitHub Desktop.
Save StuffAndyMakes/8aeb195539c530d53ca2 to your computer and use it in GitHub Desktop.
Quick free available RAM function for Arduino/AVR
// found at https://learn.adafruit.com/memories-of-an-arduino/measuring-free-memory
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment