libelium-dev wrote:
maeishoj,
Lets go by parts.
If you want to distinguish only if calibrations is done or not, just use 0 for non calibrated and 1 for calibrated, and also only one address (so you do not need to increment).
Then, in the beginning of your program, write 0 into address 310 as default vale of this address. After that, if you do calibration just write 1 in same address and when you wake up from hibernate, you can check this address to see if you previously made a calibration or not.
Do not forget to turn on all modules you want to use after hibernate.
regards.
libelium dev, that is what I wanted to do!
But since hibernate runs ALL THE CODE including the setup, if I write 0 as default vlaue in the beginning and once calibrated I write 1, then next time it wakes up it will override that address and put 0 again!
Is there a workaround?
Otherwise I just thought about setting it to 0 and do nothing else the first time i run the program.
Then i remove that line ( Utils.writeEEPROM(add, isCalibrate);) and only add it in the if sentence when I have calibrated.
the problem as I described above is that it is stuck there and won't go further..