from machine import Pin,ADC
import time
re1=Pin(20,Pin.OUT)
re2=Pin(21,Pin.OUT)
swup=ADC(Pin(28))
swdw=ADC(Pin(27))
while True:
x=swdw.read_u16()
y=swup.read_u16()
print("X:"+str(x)+",Y:"+str(y)+"--Botton Value:")
time.sleep(0.2)
re1.off()
re2.off()
if y==0:
re1.off()
re2.on()
if y==65535:
re1.on()
re2.off()
if x==0:
re1.off()
re2.on()
if x==65535:
re1.on()
re2.off()