Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void setup()
- {
- Serial.begin(9600);
- Serial.println("Initialising...");
- delay(100); //Allow for serial print to complete.
- pinMode(LED_PIN,OUTPUT);
- /*** Setup the WDT ***/
- /* Clear the reset flag. */
- MCUSR &= ~(1<<WDRF);
- /* In order to change WDE or the prescaler, we need to
- * set WDCE (This will allow updates for 4 clock cycles).
- */
- WDTCSR |= (1<<WDCE) | (1<<WDE);
- /* set new watchdog timeout prescaler value */
- WDTCSR = 1<<WDP0 | 1<<WDP3; /* 8.0 seconds */
- /* Enable the WD interrupt (note no reset). */
- WDTCSR |= _BV(WDIE);
- Serial.println("Initialisation complete.");
- delay(100); //Allow for serial print to complete.
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement