from keypad import*
from lcd4bit import*
lcd_start()
string_write("Question 3 (ii)")
sleep(5)
cmd_wrt(0x01)

while 1:
    
    val=keyread()
    
    if val=='A':
        cmd_wrt(0x01)#clear lcd
        cmd_wrt(0xc0+4) #secline=0xc0
        string_write("Welcome")
        sleep(0.5)

    elif val=='B':
        cmd_wrt(0x01)#clear lcd
        cmd_wrt(0xc0+4)
        string_write("Thank You")
        sleep(0.5)

    elif val=='C':
        cmd_wrt(0x01)#clear lcd
        cmd_wrt(0xc0+4)
        string_write("Please")
        sleep(0.5)

    elif val=='D':
        cmd_wrt(0x01)#clear lcd
        cmd_wrt(0xc0+4)
        string_write("Come Again")
        sleep(0.5)

    elif val=='#':
        cmd_wrt(0x01)#clear lcd
        cmd_wrt(0xc0+4)
        string_write("Later")
        sleep(0.5)

    elif val=='*':
        cmd_wrt(0x01) #clear lcd
        sleep(0.5)
    
    elif val!=0:
        cmd_wrt(0x80+7) #firstline=0x80
        string_write(val)
        sleep(0.2)

BOOTSELLED1239USBRaspberryPiPico©2020RP2-8020/21P64M15.00TTT