How to use idle mode on teensy 2 ?

Status
Not open for further replies.

heliboy

Active member
I read about low power operation for teensy 2 but without an example I cannot undersatnd how idle mode is to be used. I need to put the teensy 2.0 to sleep for 10 minutes and then wake up to take some data and go back to sleep.
Any help appreciated:


Use Idle Mode
Enter idle mode when nothing to do. Easy, since the normal timekeeping will wake up automatically. All peripherals stay active, everthing else will works. Compatible with most Arduino libraries.

#include <avr/sleep.h>

void idle() {
set_sleep_mode(SLEEP_MODE_IDLE);
noInterrupts();
sleep_enable();
interrupts();
sleep_cpu();
sleep_disable();
}[/I]
 
Status
Not open for further replies.
Back
Top