This code works to listen for bytes via radio (with a 433 Mhz receiver module) with the Manchester library and Manchester code, and do an action when certain bytes are received:
#include "Manchester.h"
void setup() {
pinMode(3, INPUT);
man.setupReceive(3, MAN_1200);
man.beginReceive();
}
void loop() {
if (man.receiveComplete()) {
uint16_t m = man.getMessage();
man.beginReceive(); // start listening for next message
// do something with m
}
}
But it requires to have the Arduino / ATtiny / ATmega / MCU constantly running.
Question: is there a way to put the ATtiny on deep sleep mode (to get < 1 uA consumption) and wake-up only when a byte arrives via radio?
I know how to do this with an interrupt or "pin change interrupt", but here with radio library Manchester, it's probably more complicated. How to do it?
In this case it's probably going to be more complicated than just:
sleep_enable();
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
sleep_cpu();