import time
from machine import Pin,ADC
V=ADC(Pin(25))
H=ADC(Pin(26))
S=ADC(Pin(27))
led_red=Pin(18,Pin.OUT)
led_blue=Pin(5,Pin.OUT)
led_yellow=Pin(17,Pin.OUT)
#while True:
#print("V:",V.read())
#print("H:",H.read())
#time.sleep(2)
while True:
if V.read()==4095 and H.read()==2048:
for i in range(5):
led_red.value(1)
time.sleep(0.5)
led_red.value(0)
time.sleep(0.5)
elif V.read()==2048 and H.read()==0:
led_blue.value(1)
time.sleep(0.5)
led_blue.value(0)
elif V.read()==2048 and H.read()==4095:
led_yellow.value(1)
time.sleep(0.5)
led_yellow.value(0)
#上:4095 and 2048
#右:2048 and 0
#左:2048 and 4095