CorBee
Well-known member
Hi,
For the TeensyBatdetector I am currently implementing a simple way to allow users to put the device somewhere ready to record (autorecording) ultrasounds at night without a need to look
after the device. The device is programmed with a wakeup and a sleep moment and during the sleep I want to use the snooze library.
I have allready added and tested this to the code for a Teensy 3.6 and it works fine. But for the T4.1 I do not seem to be able to get the sleep routine to recover without simply resetting.
I cant share the full code as this is part of a larger project but I followed the main guidelines:
then in setup
and finally in the loop
In the T3.6 this works, on the T4.1 it fails ... and its very unclear where it fails ...
Any help/guidance is appreciated, the snooze library seems the only public library to make this kind of thing "reasonably" simple.
kind regards
Cor
For the TeensyBatdetector I am currently implementing a simple way to allow users to put the device somewhere ready to record (autorecording) ultrasounds at night without a need to look
after the device. The device is programmed with a wakeup and a sleep moment and during the sleep I want to use the snooze library.
I have allready added and tested this to the code for a Teensy 3.6 and it works fine. But for the T4.1 I do not seem to be able to get the sleep routine to recover without simply resetting.
I cant share the full code as this is part of a larger project but I followed the main guidelines:
Code:
#include "Snooze.h"
uint16_t timerWakeup_counter = 0; //keep track of the no of wakeups
SnoozeTimer timer;
SnoozeUSBSerial usb;
#if defined(__IMXRT1062__)
SnoozeBlock config_teensy41(usb, timer);
#elif defined(__MK66FX1M0__)
SnoozeBlock config_teensy36(usb, timer);
#endif
then in setup
Code:
#if defined(__IMXRT1062__)
timer.setTimer(10);// seconds on T4.1
//alarm.setRtcTimer(0, 0, 5);
#elif defined(__MK66FX1M0__)
timer.setTimer(5000);// milliseconds on T3.6
#endif
and finally in the loop
Code:
#if defined(__IMXRT1062__)
who = Snooze.deepSleep(config_teensy41);// return module that woke processor
#elif defined(__MK66FX1M0__)
who = Snooze.sleep(config_teensy36);// return module that woke processor
#endif
delay(100); // start with a minor delay after wakeup to keep the USB-powerpack "alive"
In the T3.6 this works, on the T4.1 it fails ... and its very unclear where it fails ...
Any help/guidance is appreciated, the snooze library seems the only public library to make this kind of thing "reasonably" simple.
kind regards
Cor