Lock and Key Switch + Switch Tests

For my creative switch, I made a key going into a lock activate an LED.  I hooked up the LED to an arduino board and connected wires to both the lock and the key. The open circuit closes when the key goes into the lock. This would be great to use as an extra security measure to guarantee that your lock is locked. It’s perfect for people who are paranoid about keeping their stuff safe. Watch the video below:

Below are the videos for the 4 switch tests:

Button test:

Debounce:

DigitalInputPullup:

StateChangeDetection: