// subset of deepSleep_all_wakeups.ino example in td1.52 snooze lib
#include <DogLcd.h>
/***************************************
This shows all the wakeups for deepSleep
Supported Micros: T-LC/3.x/4.0
****************************************/
#include <Snooze.h>
// Load drivers
SnoozeTimer timer;
SnoozeUSBSerial usb;
SnoozeAlarm alarm;
/***********************************************************
Teensy 4.0 does not have a Touch Interface. Always use the
SnoozeUSBSerial Driver.
Teensy 3.6/LC can't use Timer Driver with either Touch or
Compare Drivers and Touch can't be used with Compare.
Teensy 3.5 does not Touch Interface.
Teensy LC does not have a rtc so Alarm Driver can't be
used as of yet.
Teensy 3.2 can use any Core Drivers together.
***********************************************************/
SnoozeBlock config_teensy40(usb, alarm);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
// Set RTC alarm wake up in (hours, minutes, seconds).
alarm.setRtcTimer(0, 0, 20);// hour, min, sec
}
void loop() {
int who;
/********************************************************
feed the sleep function its wakeup parameters. Then go
to deepSleep.
********************************************************/
who = Snooze.deepSleep( config_teensy40 );// return module that woke processor
if (who == 35) { // rtc wakeup value
for (int i = 0; i < 4; i++) {
digitalWrite(LED_BUILTIN, HIGH);
delay(200);
digitalWrite(LED_BUILTIN, LOW);
delay(200);
}
}
}