This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <avr/sleep.h> //Needed for sleep_mode | |
| #include <avr/wdt.h> //Needed to enable/disable watch dog timer | |
| void setup() { | |
| pinMode(0, OUTPUT);// LED connected to pin 5 which is recognised as pin 0 by arduino | |
| ADCSRA &= ~(1<<ADEN); //Disable ADC, saves ~230uA | |
| //Power down various bits of hardware to lower power usage | |
| set_sleep_mode(SLEEP_MODE_PWR_DOWN); //Power down everything, wake up from WDT | |
| sleep_enable(); | |
| } |