Author Topic: Writing to EEPROM w/ Arduino  (Read 1693 times)

0 Members and 1 Guest are viewing this topic.

Offline electron_misfireTopic starter

  • Contributor
  • Posts: 32
  • Country: au
Writing to EEPROM w/ Arduino
« on: September 06, 2014, 12:52:28 pm »
Hi all,
I'm currently experimenting with arduino. My current project is a stopwatch that saves times to EEPROM. With all the examples I've looked at every time the arduino restarts the write address is the same. Wouldn't that overwrite the existing information? If so, how would I write the code so that I don't overwrite existing bytes.
Thank you.
 

Offline Psi

  • Super Contributor
  • ***
  • Posts: 9951
  • Country: nz
Re: Writing to EEPROM w/ Arduino
« Reply #1 on: September 06, 2014, 12:57:25 pm »
Store the active eeprom address in eeprom itself.

Then you can keep track of it and write to the next available address.

You may also want to change the EESAVE fuse bit so that reprogramming the arduino doesnt clear the eeprom.
« Last Edit: September 06, 2014, 12:59:08 pm by Psi »
Greek letter 'Psi' (not Pounds per Square Inch)
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf