print("Hello, ESP32!")
import machine
from machine import Pin
def contarTrue(X,Y,Z):
return X+Y+Z
ledRojo = Pin(12,Pin.OUT)
ledAzul = Pin(14,Pin.OUT)
sliderA = Pin(5,Pin.IN,Pin.PULL_UP)
sliderB = Pin(4,Pin.IN,Pin.PULL_UP)
sliderC = Pin(2,Pin.IN,Pin.PULL_UP)
while True:
A = sliderA.value()
B = sliderB.value()
C = sliderC.value()
if(contarTrue(A,B,C) <=1):
Y = A or C
X = B or C
ledRojo.value(Y)
ledAzul.value(X)
print("A="+str(bool(A))+" B="+str(bool(B))+" X="+str(bool(X))+" Y="+str(bool(Y)))
else:
print("Hay dos o mas sliders prendidos")