Battery Powered Boron and Motion Sensor (PIR)

AFAICT the nRF52840 does have a BackupRAM feature, but it might not have been implemented or just wasn’t documented yet.
It’s still worth a try - unfortunately, I haven’t got a device with me right now to test :pensive:, but this code builds without errors

const int LED = D7;
retained int x;
void setup() {
    pinMode(LED, OUTPUT);
    digitalWrite(LED, (x == 123));
    x = 123;
}
2 Likes