Skip to content

Instantly share code, notes, and snippets.

@b13n1u
Created April 4, 2021 20:35
Show Gist options
  • Save b13n1u/08922d2f821ee378c563130ce2c1b881 to your computer and use it in GitHub Desktop.
Save b13n1u/08922d2f821ee378c563130ce2c1b881 to your computer and use it in GitHub Desktop.
Get ESP8266 memory stats
void loop()
{
static uint32_t lastmin=65536;
static uint32_t myfree;
static uint16_t mymax;
static uint8_t myfrag;
ESP.getHeapStats(&myfree, &mymax, &myfrag);
Serial.printf("(%d) -> free: %5d - max: %5d - frag: %3d%% <- \n", millis(), myfree, mymax, myfrag);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment