Goal:
I want to create a combination that allows me to push desired button in the desired order to unlock a green LED.
Description:
3 buttons to control red and green button. Red button means still lock but more step needed, Green button means unlock.
- How it works: You have to push the 1st button to trigger the 2nd button, then push the second button to unlock the green LED. (Like a step-by-step unlock process)
Problem (solved):
The problem is that I cannot release buttons. Once I push the first one I have to hold it to while pushing the second one to make it work. My original intention is once I push the button even I release it the button will still work.
Materials:
- Arduino UNO R3 x 1
- Breadboard x 1
- Buttons x 3
- Red LED x 3
- Green LED x 1
- 220Ω Resistors x 3
- Wires
Connection Diagram:
Code:
Github Link: https://github.com/jiany457/PCom/blob/master/CombinationLock/version1/version1.ino