first commit
This commit is contained in:
14
libraries/TinySuite/examples/watchdog/main.cpp
Normal file
14
libraries/TinySuite/examples/watchdog/main.cpp
Normal file
@@ -0,0 +1,14 @@
|
||||
#include <avr/interrupt.h>
|
||||
#include <TinyWatchdog.h>
|
||||
#include <TinySleep.h>
|
||||
|
||||
int main() {
|
||||
sei();
|
||||
Watchdog.arm(9, [](){
|
||||
// do something after 8 seconds (prescaler value of 9 translates to 8 seconds)
|
||||
});
|
||||
deepSleep();
|
||||
// at this point the watchdog will interrupt the sleep
|
||||
cli();
|
||||
deepSleep();
|
||||
}
|
||||
Reference in New Issue
Block a user