Separate the "getting the thing to do" (entering the key code) from the "doing the thing".
A simple state machine (good search term there) will help.
Get rid of "delay()"s.
Make your functions non-void, so they actually do return something.
Separate the "getting the thing to do" (entering the key code) from the "doing the thing".
A simple state machine (good search term there) will help.
Get rid of "delay()"s.
Make your functions non-void, so they actually do return something.