Recalling the last value from the encoder after starting the Arduino

Hello all readers. I am working on a pressure controller based on analog sensors and encoders for setting pressure values. My problem now is that the value set by the encoder after resetting the Arduino returns to zero. The system is intended to be used to inflate the wheels on the vehicle, so this arrangement is unacceptable. I want to achieve remembering the last value or program the value to be loaded at boot. Nod SELECT doesn’t work or I’m making some mistake.I will be grateful for every hint.

select-S2 is set to loop. I’m guessing that triggers before you use the boot value. You don’t include the rest of the code showing what you do with initial value. Can you pulse select-S2 after using ENK1 when you are done with boot value? It won’t hurt to keep pulsing select-S2 each time you use the ENK1 value…

Welcome back.
I partially solved the problem. I am able to set the value loaded at boot and add or subtract from this value by pressing specific buttons. My task now is to find out if the Arduino is able to save variables and recall them on the next boot. Is Arduino capable of this?

There are several libraries for using EEPROM: Libraries — XOD.

Keep in mind that excessive writes to EEPROM will eventually burn out your Arduino…

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.