MAJOR DISCLAIMER: I haven't tried to do ANY of this. It's all a guess.
You can't do it using the arduino attachInterrupt() call, since arduino doesn't have a number for reset interrupts. You would have to use the ISR() macro. I don't know if there's a mnemonic for the reset vector, but
- Code: Select all
ought to work.
After you turn off the lights, you will have to jump to the real reset handler in the boot loader. To do that, I think all you have to do is jump to 0x0000.