Resetting with an IR remote

Hi
I have a problem with resetting my Arduino mega board. Now I know I could simply press the reset button on the board but I would like to do it using an IR remote. How do I make my IR remote overwrite the current code and make the board stop what its currently doing and follow the instructions from the IR receiver.
Any help is greatly appreciated?
Thanks

Firstly you need to write a program to read the remote. To do this you will need the correct sensor. This is one that decodes the IR. It is not a two wire IR phototransistor.

Once you can read the remote then you are just about there.

The IR will not overwrite the existing code just move to the part of the code to do what you want.

There is a lot of information on remote IR. Just use the Search box at the top of this page.

Weedpharma