Hey folk,
I’ve been messing around with interrupts (LSM303 accelerometer triggered) and sleeping. It’s working well (20/20 hindsight note, don’t power the sensor with Vext…because it turns ~off on sleep. I got 1.8v out of it too, which was weird).
The main loop doesn’t sleep if there is LoRaWAN traffic pending, which is great, and the LoRaWAN timer wakes up when required in parallel with my pin interrupt. It’s taken a little while to get working, so I though I’d share my happiness. Nice work Heltec team.
It may not be obvious (there is comment in the sleep example code) but the board only sleeps fully (loop() stops) after calling sleep successfully six times. I suspect it’s progressing down through a sleep level on every call? If someone knows please enlighten me.
Also…millis() resets. I’ve not yet found a way to track the passing of time, although there must be something in the stack as it surely respects the duty cycle.
Bruce