Hello,
i want to use a sleep mode in my sketch in the following way. I upload the sketch to arduino, the programm goes to sleep mode and waites befor i press a button. I dont understand how can I do it correctly.
I thought of this sketch:
If I conect the Button to Interrupt pin, Arduino wakes up after I press it? Or how can I say to arduino to wake up after i press a button?
[attachInterrupt(0, pin2_isr, HIGH);
set_sleep_mode(SLEEP_MODE_PWR_DOWN);
cli();
sleep_enable();
sleep_bod_disable();
sei();
sleep_cpu();
/* wake up here */
sleep_disable(); ]