Just remember a few things before you go off an go all EEPROM-crazy.
First, your EEPROM is rated for 100000 write cycles. So don't write to it every time loop is called or it will go bust in a few minutes. The proper way to do is to write to the EEPROM only when the relevant value change or every hour or so.
Second, when you read the EEPROM at start-up, expect it to have the wrong value from your previous experiments with EEPROMs. That memory isn't initialised. Always check at the first reading if the values read are safe and inside expected parameters, if not ignore them and use default values. After the next writing, that problem will be solved.
wow.. this is getting harder for my "noobility" (hey, a new word) to follow.. :-[
If you don't mind, could you give me an easier explanation by.. giving example on how to save float Shift = 7000.0 ?
EDITED:
I have an idea, how about :
ShiftStore = Shift/100;
//then I store the value to the EEPROM which is 0-255
EEPROM.write(0,ShiftStore);
//and then to read it
ShiftStore=EEPROM.read(0);
Shift=ShiftStore*100;
#include <EEPROM.h>
float ShiftStore;
float Shift;
void setup()
{
ShiftStore=float(EEPROM.read(0)); //read stored byte as float
Shift=ShiftStore*100;
}
void loop()
{
//to save
if(bouncer3.read()==HIGH)
{
ShiftStore=Shift/100; //to divide so it could be saved as value between 0-255
EEPROM.write(0,byte(ShiftStore)); //to save the float as byte
lcd.print("Saved");
delay(1000);
digitalWrite(ChangeModePin, LOW);
k=0;
}
}
I will reporting back as soon as I've uploaded it to my board
First, your EEPROM is rated for 100000 write cycles. So don't write to it every time loop is called or it will go bust in a few minutes./code]
Just putting this out there:
I always use I2C EEPROM for this kind of thing. You dont have to worry about burning out your onboard eeprom, and is an I2C bus so you can put multiple of them on a single bus.