Have you ever thought of having your own digital locker to protect the things you treasure? Like a digital locker for your treasure box, yes, it’s possible! When you enter the correct password in the digital locker’s touchpad, the box gets opened; otherwise, it’s kept closed, and your things are safe.
You could build a digital locker using a Python STEM Board, which has a cool touchpad LED screen and more, this board could be programmed using Micro-Python.
You can also enhance the locker by adding lights and sound effects and you could even set an alarm for entering the wrong password!
Initialize mPython libraries
Initialize touchpads, OLED, RGB LEDs
Display instructions on OLED: "Enter your password" and "using Touchpad"
Define password as ["Y", "N", "P", "T", "H", "O"]
Set i to 0 (index of password)
While i < 6:
Check if any touchpad is pressed
If touchpad pressed, compare input with the password at position i
If wrong, exit loop (wrong password)
If correct, increment i
Wait for 1 second
If i < 6 (wrong password):
Set RGB LEDs to red
Display "WRONG PASSWORD" on OLED
Else (password correct):
Set RGB LEDs to yellow
Display "Device unlocked!!!" on OLED