One of the many little hassles today, is with a sketch where I store any incoming data in eeprom, with the idea of displaying this value after a power outage,
The error is the variable scoping of two different instances of digA
You have declared it in global scope above the setup function and also again inside the setup
So inside setup your code is using the locally declared copy of digA which is not the same as the variable declared globally
You could fix this by removing the int. from I front of its declaration in setup()
So that you are only using the global instance.
I'm also a bit curious why you don't just read from the EEPROM when you need to get the digA value, its a waste of global variable space, unless you intend to do a lot of high speed processing.
Thanks for the replies guys, you got it there Roger, when I removed the int from in setup, all is well.
I just want to get caught up with my 22 projects, and then read a bit more about all this stuff, ( and even update to V1 ) but at the moment its just juggling balls in the air, but it is great to have you guys for advice.
And I did just think about reading the eeprom for the display, but can't remember why I didnt, - oh yes, I was going to check if reading an eeprom had a life limit, but I dont think so ...
It wouldnt be an issue in my application anyway, the data will probably only be changed once a month anyway, but I need to read the data after a power failure ( quite a lot here in Africa
Boffin1 can you please give me schematic for your circuit which keeps (to use your own words) 5v steady for 310mS after power is cut..
(was about to PM both u guys when found this thread)
thanks a lot
as far as reading eeprom goes it won't harm eeprom..just one point i like to mention..writing eeprom @ same address (starting 0) may wear out those bytes..keep changing the addresses..by say keeping a counter..