import keypad as key
import lcd4bit as lcd
from utime import sleep
pwd="5678"
sleep(0.1)
print("start")
lcd.strwrite("insert password")
passin=""
while 1:
    a=key.getkey()
    if a!=0:
        print(a)
        if a=='#':
            if passin==pwd:
                lcd.cmdwrite(0x80)
                lcd.strwrite("correct password")
            else:
                lcd.cmdwrite(0x80)
                lcd.strwrite("wrong   password")
            passin=""
        elif a=='*':
            lcd.cmdwrite(0x01)
            lcd.strwrite("insert password")
            passin=""  #reset variable 
        else:
            passin+=a
            print(passin)
            lcd.cmdwrite(0xc4)
            lcd.strwrite("           ")
            lcd.cmdwrite(0xc4)
            for i in passin:
                lcd.strwrite('*')                     
    sleep(0.3)
    
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT