Hey, I am trying to save values on the eeprom of my a-star 328pb microcontroller, so if the power dies then it will recall the position value of my motor. I am following the same format as I would usually do it with an arduino. Below is the code I am using (I have completely broken it down just to get this section working, but it doesn’t seme to work). I am not sure why it isn’t working.
When I run the below code I get back in the serial
“Value: nan”
#include <EEPROM.h>
void setup() {
// put your setup code here, to run once:
EEPROM.put(1, 10);
Serial.begin(9600);
delay(1000);
Serial.print("Value: ");
float val = 0;
EEPROM.get(1, val);
Serial.println(val);
}
void loop() {
// put your main code here, to run repeatedly:
}