We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prevents weird hung states when unplugging Scouts after configuration.
http://forum.arduino.cc/index.php?topic=63651.0
c++ /* Watchdog Timer Basic Example 10 June 2011 Nicolas Larsen */ #include <avr/wdt.h> int loop_count = 0; void setup() { Serial.begin(9600); Serial.println("Starting up..."); pinMode(13,OUTPUT); digitalWrite(13,HIGH); delay (500); watchdogSetup(); } void watchdogSetup(void) { cli(); # # // disable all interrupts wdt_reset(); // reset the WDT timer /* WDTCSR configuration: WDIE = 1: Interrupt Enable WDE = 1 :Reset Enable WDP3 = 0 :For 2000ms Time-out WDP2 = 1 :For 2000ms Time-out WDP1 = 1 :For 2000ms Time-out WDP0 = 1 :For 2000ms Time-out */ // Enter Watchdog Configuration mode: WDTCSR |= (1<<WDCE) | (1<<WDE); // Set Watchdog settings: WDTCSR = (1<<WDIE) | (1<<WDE) | (0<<WDP3) | (1<<WDP2) | (1<<WDP1) | (1<<WDP0); sei(); } void loop() { for (int i = 0; i <= loop_count;i++){ digitalWrite(13,HIGH); delay(100); digitalWrite(13,LOW); delay(100); } loop_count++; wdt_reset(); Serial.print(loop_count); Serial.print(". Watchdog fed in approx. "); Serial.print(loop_count*200); Serial.println(" milliseconds."); } ISR(WDT_vect) // Watchdog timer interrupt. { // Include your code here - be careful not to use functions they may cause the interrupt to hang and // prevent a reset. }
The text was updated successfully, but these errors were encountered:
quartzjer
No branches or pull requests
Prevents weird hung states when unplugging Scouts after configuration.
http://forum.arduino.cc/index.php?topic=63651.0
The text was updated successfully, but these errors were encountered: