from machine import Pin
'''#上拉电阻
LED=Pin(26,Pin.OUT)
LED.value(0)
key=Pin(5,Pin.IN,Pin.PULL_UP)
while True:
if key.value() == 0:
LED.value(1)'''
#下拉电阻
LED = Pin(26,Pin.OUT)
LED.value(0)
key = Pin(5,Pin.IN,Pin.PULL_DOWN)
while True:
if key.value() == 1:
LED.value(1)
else:
LED.value(0)