Last active
July 18, 2021 23:22
-
-
Save futureshocked/518cfd39c0a25ccc7d2b441edb03e6d2 to your computer and use it in GitHub Desktop.
This sketch will read the long in EEPROM address 0.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This sketch will read the long in EEPROM address 0. | |
// Written by Peter Dalmaris from Tech Explorations. | |
// Used to find out how long an ESP32 can last on a LiPo battery. | |
// https://techexplorations.com | |
#include "EEPROM.h" | |
int addr = 0; | |
#define EEPROM_SIZE 32 | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("start..."); | |
if (!EEPROM.begin(EEPROM_SIZE)) | |
{ | |
Serial.println("failed to initialise EEPROM"); delay(1000000); | |
} | |
Serial.println(" bytes read from Flash . Count is:"); | |
long count = EEPROM.readLong(addr); | |
Serial.print(count); | |
Serial.print(" "); | |
Serial.println(); | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment