from machine import Pin
import time
from pico_gpio_lcd import GpioLcd
# LCD selon ton diagram.json
lcd = GpioLcd(
rs_pin=Pin(19),
enable_pin=Pin(20),
d4_pin=Pin(22),
d5_pin=Pin(26),
d6_pin=Pin(27),
d7_pin=Pin(28),
num_lines=2,
num_columns=16
)
# Boutons GP1 à GP4
bouton1 = Pin(1, Pin.IN, Pin.PULL_UP)
bouton2 = Pin(2, Pin.IN, Pin.PULL_UP)
bouton3 = Pin(3, Pin.IN, Pin.PULL_UP)
bouton4 = Pin(4, Pin.IN, Pin.PULL_UP)
lcd.clear()
lcd.putstr("Systeme pret")
etat = 0
while True:
if not bouton1.value() and etat != 1:
lcd.clear()
lcd.putstr("Lancement Word")
etat = 1
elif not bouton2.value() and etat != 2:
lcd.clear()
lcd.putstr("Lancement ChatGPT")
etat = 2
elif not bouton3.value() and etat != 3:
lcd.clear()
lcd.putstr("Lancement PacketTracer")
etat = 3
elif not bouton4.value() and etat != 4:
lcd.clear()
lcd.putstr("Lancement Flightradar")
etat = 4
time.sleep(0.1)