user14300: I am a big noob I know that
but can this code be used to reset arduino board (instead of pressing the usual reset button on the board) 
I want to reset the board as If am pressing the reset button using IR 
int receiverpin = 2; // pin 1 of IR receiver to Arduino digital pin 2
#include <IRremote.h>
IRrecv irrecv(receiverpin); // create instance of irrecv
decode_results results;
void setup()
{
irrecv.enableIRIn(); // start the receiver
}
void(* resetFunc) (void) = 0; //declare reset function @ address 0

void loop()
{
 if (irrecv.decode(&results)) // have we received an IR signal?
{
if(results.value == 0x2FD847B) //if the button press equals the hex 
{
  resetFunc();
}
{
irrecv.resume(); // receive the next value
}
}
}


user4143: Kind of, yes.  That doesn't actually reset the Arduino, it just sends the program to address 0.
There are two other ways of performing the reset that do a proper full reset:

Enable the watchdog timer and let it time out to reset the CPU.
Connect an IO pin to the RESET pin - keep it in INPUT most of the time but set it to OUTPUT and LOW when you want to reset.

By just jumping to address 0 you aren't resetting the internal peripherals and registers to their reset state, so things like timers and such will still be running when they shouldn't be, etc.  It's better by far to do a real reset instead of just jumping to 0 like that.

14300: <p>I am a big noob I know that</p>

<p>but can this code be used to reset arduino board (instead of pressing the usual reset button on the board) </p>

<p>I want to reset the board as If am pressing the reset button using IR </p>

<pre><code>int receiverpin = 2; // pin 1 of IR receiver to Arduino digital pin 2
#include &lt;IRremote.h&gt;
IRrecv irrecv(receiverpin); // create instance of irrecv
decode_results results;
void setup()
{
irrecv.enableIRIn(); // start the receiver
}
void(* resetFunc) (void) = 0; //declare reset function @ address 0

void loop()
{
 if (irrecv.decode(&amp;results)) // have we received an IR signal?
{
if(results.value == 0x2FD847B) //if the button press equals the hex 
{
  resetFunc();
}
{
irrecv.resume(); // receive the next value
}
}
}
</code></pre>
 4143: <p>Kind of, yes.  That doesn't actually reset the Arduino, it just sends the program to address 0.</p>

<p>There are two other ways of performing the reset that do a proper full reset:</p>

<ol>
<li>Enable the watchdog timer and let it time out to reset the CPU.</li>
<li>Connect an IO pin to the RESET pin - keep it in INPUT most of the time but set it to OUTPUT and LOW when you want to reset.</li>
</ol>

<p>By just jumping to address 0 you aren't resetting the internal peripherals and registers to their reset state, so things like timers and such will still be running when they shouldn't be, etc.  It's better by far to do a real reset instead of just jumping to 0 like that.</p>
