import keypad as key
import lcdi2c as lcd
from utime import sleep
password="1234"
temp_pass=""
sleep(0.01)
lcd.str_wrt(" welcome")
while 1:
a=key.getkey()
if a!=0: #only run when keypad pressed
print(a)
if a=="#":
lcd.cmd_wrt(0x01)
lcd.cmd_wrt(0x85)
if password==temp_pass:
lcd.str_wrt("correct")
else:
lcd.str_wrt("false")
temp_pass=""
elif a=="*":
lcd.cmd_wrt(0x01)
temp_pass="" #clear input password
else:
lcd.cmd_wrt(0xc5)
temp_pass+=a
for i in temp_pass:
lcd.str_wrt("*")
print(temp_pass)