import machine
from machine import Pin
LedRojo = Pin(14,Pin.OUT)
LedAmarillo = Pin(26,Pin.OUT)
LedAzul = Pin(33,Pin.OUT)
LedVerde = Pin(32,Pin.OUT)
Entrada1 = Pin(22,Pin.IN,Pin.PULL_UP)
Entrada2 = Pin(21,Pin.IN,Pin.PULL_UP)
while True:
A = Entrada1.value()
B = Entrada2.value()
rojo = ((not A) and (not B))
amarillo = B and (not A)
azul = A and (not B)
verde = A and B
LedAmarillo.value(amarillo)
LedAzul.value(azul)
LedRojo.value(rojo)
LedVerde.value(verde)