Photon EEPROM returning 0x0 even though I have never written to it

Not sure what is going on exactly, I set up some basic EEPROM code that I was going to use later, so for now it just reads the value and if it returns 0xFF sets the variable to a default value. I have never written to the EEPROM at any address, yet it returns 0. Any suggestions on something that could have gone wrong?

Do you get 0x00 on any address or just some specific ones?
Are you using EEPROM.read() or EEPROM.get()?

Looks like I am only getting it at address 0x0, and I am using EEPROM.get() with a uint8_t variable.

Edit: I think i figured out the issue actually, looks like one of our other programmers changed the addresses they were storing the variable in, and a previous variable was saved in there. Thanks for your help, sorry I didn’t see that sooner.

2 Likes