just installed td 1.52 over 1.48. had to delete the "utilities" folder in snooze lib when compiler said cannot use src and utility folder both - utility folder was i guess
a leftover from 1.48 which did not get removed at install 1.52
took from the examples folder deepSleep_all_wakeups.ino and removed all lines did not need for a simple test using deep sleep via rtc
that subset of code is shown below.
for some reason need to include usb in this line SnoozeBlock config_teensy40(usb, alarm) or it does not function even when plugged
into PC usb port. stand alone (just power applied to +5 and gnd pins) it does not function even with usb included that line. Will not
have a PC later in actual application.
Am I misunderstanding something ? Is there a way for the T4 deepsleep to work stand alone ? I see the comment line about T4 and
usb but do not understand it. Any help appreciated.
Code:
// 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);
}
}
}