from machine import Pin
from lcd1602 import LCD
import utime as time
lcd=LCD()
pb20 = Pin(20,Pin.IN,Pin.PULL_UP)
pb21 = Pin(21,Pin.IN,Pin.PULL_UP)
def display_splash_screen():
lcd.write(0,0," Push PB to ")
lcd.write(0,1," explore menu ")
lcd.clear()
display_splash_screen()
time.sleep(1)
menu=0
while True:
if pb20.value() == 0:
menu=menu+1
while pb20.value()==0:
pass
if pb21.value() == 0:
menu=menu-1
while pb21.value()==0:
pass
if menu==-1:
menu=3
if menu==4:
menu=0
if menu==0:
lcd.write(0,0,"1. Nasi Lemak ")
lcd.write(0,1," $: RM23.50 ")
if menu==1:
lcd.write(0,0,"2. Mee Goreng ")
lcd.write(0,1," $: RM14.00 ")
if menu==2:
lcd.write(0,0,"3. Roti Canai ")
lcd.write(0,1," $: RM15.40 ")
if menu==3:
lcd.write(0,0,"4. Laksa Penang ")
lcd.write(0,1," $: RM27.80 ")