import machine
from machine import Pin
#definimos salida
ledRojo = Pin(12,Pin.OUT)
#definimos entradas
SliderA = Pin(2,Pin.IN,Pin.PULL_UP)
SliderB = Pin(4,Pin.IN,Pin.PULL_UP)
SliderC = Pin(5,Pin.IN,Pin.PULL_UP)
while True:
A = SliderA.value()
B = SliderB.value()
C = SliderC.value()
#Tabla de verdad de AND
# A | B | C | AND
#-----------------
# 0 | 0 | 0 | 0
# 0 | 0 | 1 | 0
# 0 | 1 | 0 | 0
# 0 | 1 | 1 | 0
# 1 | 0 | 0 | 0
# 1 | 0 | 1 | 0
# 1 | 1 | 0 | 0
# 1 | 1 | 1 | 1
AND = (A and B and C)
ledRojo.value(AND)