I have a problem which seems to be board specific.
I tried to run the code copied below on my duemilenova. The code runs a loop that goes slower and slower till the watchdog resets the board.
The code runs fine till the first reset triggered by the watchdog. Then led L starts blinking really fast and never stops doing so.
Pressing the reset button does not help. Taking away power and plugging it back in repeats the scenario as described above.
As the code was taken from the forum and the watchdog flag needs to be reset in the startup code, I thought this may be bootloader related so I burned the bootloader with version 1.0.2 of the Arduino IDE.
This did not solve the problem.
Then I tried with a mega and a leonardo. The mega behaves the same but the leonardo works fine.
So I'm wondering what is wrong here.
Anyone can help?
// Do not remove the include below
// Watchdog Timer Example
unsigned long ToggleDelay; // When this delay grows to longer than the WDT interval the WDT resets the Arduino
const int LEDpin = 13;
ToggleDelay = 1; // Start with a very short delay
wdt_enable(WDTO_250MS); // Set watchdog to 1/4 second
toggle_led(); // Blinking goes slower and slower until the WDT causes reset, then starts over.
ToggleDelay += 5; // Increase the delay by 5 milliseconds.