thank you both, nope I want to use this chip because of low pin count. can I add my desired code to the beginning of the program before the while (1) loop (for example send "turn off the first light" command) and connect the switch to ground in order to reset the chip whenever the switch is pressed and when is resets it restarts the whole program from the beginning and so turns it off?
I also won't replace the batteries much.