Help with RFID code

Hello I am very new to Arduino. I have Arduino UNO. I have an RFID sketch running on it to unlock my door as well as turn on the overhead light. This is all working great but what I would like to add and cannot seem to get working is a pushbutton on analog input 0 that when pushed will activate the unlock portion of the code just like reading A valid card as well as set digital pin 7 high Delay 500 ms set pin 7 low again. I just cannot get this to work. Attached is the working code without any of the pushbutton code.
Any help on this would be great. Thank you

Working_RFID.ino (17.1 KB)

Have a look at Nick Gammon's switch tutorial (Gammon Forum : Electronics : Microprocessors : Switches tutorial), write some code, and if you have problems, come back and post your code.

I'll have a look at that thank you.

I had a look at (Gammon Forum : Electronics : Microprocessors : Switches tutorial) really good information I tried taking some code from there and adding into my code no luck so far. I'm still pulling my hair out but still playing with it.

I'm still pulling my hair out but still playing with it.

So, you changed your code, and it isn't doing what you want. You haven't shared the code, the schematics, what the code actually does, or what you want it to do. All we can do, then, is wish you luck.

Good luck.

Quote

So, you changed your code, and it isn’t doing what you want. You haven’t shared the code, the schematics, what the code actually does, or what you want it to do. All we can do, then, is wish you luck.

In my first post I attached the code that was working and stated how I would like to modify it.

After quite a bit of playing around I seem to have it working pretty good with my mummification I’m sure there is a better way of doing some things so don’t laugh at me too much. I will attach what I Have going so far.

RFID.txt (15.6 KB)