The seesaw firmware that ships with the ATtinyxxx breakouts provides access to the 128 byte EEPROM. This example reads from and writes to the EEPROM.
Follow the steps on the Arduino page to get set up.
/* * This example shows how to read and write EEPROM data. Try writing * then removing power from both devices, commenting out the write, and * uploading again. */ #include "Adafruit_seesaw.h" Adafruit_seesaw ss; void setup() { uint8_t eepromval; Serial.begin(115200); while (!Serial) delay(10); // wait until serial port is opened if(!ss.begin()){ Serial.println(F("seesaw not found!")); while(1) delay(10); } Serial.println(F("seesaw started OK!")); Serial.print(F("Initial read from address 0x02...0x")); eepromval = ss.EEPROMRead8(0x02); Serial.println(eepromval, HEX); Serial.println(F("Incrementing value to address 0x02")); ss.EEPROMWrite8(0x02, eepromval+1); Serial.print(F("Second read from address 0x02...0x")); Serial.println(ss.EEPROMRead8(0x02), HEX); } void loop() { //DONT WRITE EEPROM IN A LOOP!!!! YOU WILL DESTROY YOUR FLASH!!! }
Once you've successfully uploaded the sketch to your board, open the Serial Monitor (Tools->Serial Monitor), and see the info printed out!
Page last edited January 22, 2025
Text editor powered by tinymce.