官网Pin链接
这里测试nodemcu板载led
其引脚编号为16
from machine import Pin
p0 = Pin(16, Pin.OUT) # create output pin on GPIO0
p0.off() # set pin to "off" (low) level
在交互窗口中输入上诉程序,即可点亮板载led
闪烁
from machine import Pin
import time
p0 = Pin(16, Pin.OUT) # create output pin on GPIO0
while(1):p0.off() # set pin to "off" (low) leveltime.sleep(1)p0.on() # set pin to "off" (low) leveltime.sleep(1)
Pin
classmachine.Pin(id, mode=- 1, pull=- 1, *, value, drive, alt)