from keypad import*
from lcdi2c import*
from utime import sleep
password='123456'
tmp_pass=''

def check_pass(paswd):
    if paswd==password:
        return True
    else:
        return False

lcd_start()
cmd_wrt(0x80+4)
string_write("Start")
cmd_wrt(0xc0)
while 1:
    
    val=keyread()
        
    if val=='#':
        cmd_wrt(0xc0)
        cmd_wrt(0x01)
        result=check_pass(tmp_pass)      
       
        if result==1:
            string_write("Correct Pass")
        else:
            string_write("Wrong Pass")  
        tmp_pass=''  #clear memory

    elif val!=0:
        cmd_wrt(0xc0)
        tmp_pass+=str(val)
        print(tmp_pass)
        string_write('*' * len(tmp_pass))     
       
    sleep(0.2)
BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT