mattlogue:
I just get 0's.I haven't messed with these for two decades. I'm not adept.
you are stomping on your 32 bit value moving only one byte in EEPROM.
The EEPROM library can save an object:
#include "EEPROM.h"
constexpr int EEPROM_LOCATION = 0;
struct MyStoredData {
int a2;
int a3;
};
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
pinMode(6, INPUT_PULLUP);
// pinMode(A2, INPUT);
// pinMode(A3, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
if (digitalRead(6) == LOW) {
MyStoredData readings;
readings.a2 = analogRead(A2);
readings.a3 = analogRead(A3);
EEPROM.put(EEPROM_LOCATION, readings);
}
if (digitalRead(6) == HIGH) {
MyStoredData stored;
EEPROM.get(EEPROM_LOCATION, stored);
Serial.print("A2: ");
Serial.print(stored.a2);
Serial.print(" ... A3: ");
Serial.println(stored.a3);
}
delay(500);
}