Ok first off I’m kind of new to the Arduino and coding world. I have been working on a set up with the RC522 RFID reader and the code I'm trying to use is a system with a master card (you swipe that card and can add unknown cards or delete known cards) and an RGB LED. When the program starts up on the Arduino after uploading it, you swipe what you want to be the master card then the system goes into ready mode. You can swipe the master card again and the arduino goes into program mode. If you swipe the master card again the Arduino exits program mode and goes into ready mode. This part works just fine. The problem starts when you swipe another card to be programed in as an accepted card. The system freezes up. If the reset button is pressed the Arduino resets and goes into ready mode with the master card remembered. When an unknown card gets swiped in ready mode, the program again freezes up. The end goal here is to flip a relay for a short period of time. I can’t seem to figure out how to get past the program freezing up either trying to program a card or just to get it to decline an unknown card. Any help is greatly appreciated.
rfid_access_control.ino (24.4 KB)