Skip to content

Instantly share code, notes, and snippets.

@Threeethan
Created January 6, 2014 17:28
Show Gist options
  • Save Threeethan/8286266 to your computer and use it in GitHub Desktop.
Save Threeethan/8286266 to your computer and use it in GitHub Desktop.
Quick and dirty estimate of free ram on Arduino
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
Serial.print("Free Ram = "); Serial.println (freeRam());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment