Remove these ads by
Signing UpStep 1: Using 1 wire connected to the RESET pin
In this example, pin 13, connected to the internal LED pin 13 is blinking. Pin 12 gets connected to the RESET pin by one wire.
-Typically, this would be a problem because when the application starts up, all pins get pulled LOW. This would therefore disable Arduino from every running. BUT, the trick is: in setup() function, the FIRST thing that happens is we write HIGH to the pin 12, which is called our reset pin (digitalWrite(resetPin, HIGH), thereby pulling the Arduino RESET pin HIGH.







































Visit Our Store »
Go Pro Today »




Lefty.
It could have more useful applications in larger programs though. For example..
I once wrote a program when I was in geometry for a watch to extend its functionality. After every set of numbers I input I wanted it to give me an answer, wait 5 seconds and then reset itself so it was primed up for another set of numbers.
Admittedly this was a very lazy way for me do accomplish this but it got the job done.
Hope that helps.
Setup the WDT and then make an infinity loop
WDTCSR=(1< WDTCSR= (1< for(;;)
and in the 16ms the mcros will reset and the MCUSR variable will
have the value WDRF
With your software the MCUSR will have an Unspecified value.
WDTCSR=(1<<WDE) | (1<<WDCE) ;
WDTCSR= (1<<WDE)
for(;;)