import machine
from machine import Pin
#Salidas
ledRojo = Pin(3,Pin.OUT)
ledVerde = Pin(4,Pin.OUT)
ledAzul = Pin(5,Pin.OUT)
#Entradas
SliderA = Pin(6,Pin.IN,Pin.PULL_UP)
SliderB = Pin(7,Pin.IN,Pin.PULL_UP)
SliderC = Pin(8,Pin.IN,Pin.PULL_UP)
while True:
A = SliderA.value()
B = SliderB.value()
C = SliderC.value()
mayoria = ( (A and B) or (A and C) or (B and C))
ledRojo.value(mayoria)
Loading
esp32-c3-devkitm-1
esp32-c3-devkitm-1