New to this, trying to store a persistent number between boots but it rolls over after 8 bits. Works as expected until I hit 256. Is each address only capable of holding a byte? How do I abstract that away to store larger numbers?
Code: Select all
#include <EEPROM.h>
#define EEPROM_SIZE 512
int numClick = 0;
in setup()
Code: Select all
EEPROM.begin(EEPROM_SIZE);
numClick = EEPROM.read(0);
in loop() on certain condition
Code: Select all
numClick = EEPROM.read(0);
........
numClick++;
........
EEPROM.write(0, numClick);
EEPROM.commit();