Hi All,
Great stuff on the Teensy and all the amazing libraries especially targeted to it.
I have an embedded application where the Teensy will be powered 24/7. It will sleep (hibernate or deepSleep) using the Snooze library. Occasionally, I may want to program the Teensy. Problem is, it will be inaccessible, so I won't be able to press the Program button.
Normally that's not an issue, but I'm finding that the Teensy will not respond to a USB-based request to enter program mode AFTER it has been slept and woken. Does anyone have any experience of solving this issue?
I don't want to add a manual button to my project due to its embedded nature - I only have two button inputs to the project and these have different functions.
Here's my code. Yes, I am using the USBSerial driver for Snooze.
Andrew
Great stuff on the Teensy and all the amazing libraries especially targeted to it.
I have an embedded application where the Teensy will be powered 24/7. It will sleep (hibernate or deepSleep) using the Snooze library. Occasionally, I may want to program the Teensy. Problem is, it will be inaccessible, so I won't be able to press the Program button.
Normally that's not an issue, but I'm finding that the Teensy will not respond to a USB-based request to enter program mode AFTER it has been slept and woken. Does anyone have any experience of solving this issue?
I don't want to add a manual button to my project due to its embedded nature - I only have two button inputs to the project and these have different functions.
Here's my code. Yes, I am using the USBSerial driver for Snooze.
Code:
SnoozeDigital motionDigital;
SnoozeDigital ignDigital;
SnoozeUSBSerial usb;
SnoozeBlock config_teensy32(usb, motionDigital, ignDigital);
motionDigital.pinMode(wakePin, INPUT, FALLING);//pin, mode, type
ignDigital.pinMode(ignPin, INPUT, RISING);//pin, mode, type
int who = Snooze.hibernate( config_teensy32 );// return module that woke processor
// wait for serial monitor
elapsedMillis time = 0;
while (!Serial && time < 1000) {
Serial.write(0x00);// print out a bunch of NULLS to serial monitor
digitalWriteFast(LED_BUILTIN, HIGH);
threads.delay(30);
digitalWriteFast(LED_BUILTIN, LOW);
threads.delay(30);
}
// normal delay for Arduino Serial Monitor
threads.delay(2000);
Andrew