基于ESP8266-NodeMCU,在MicroPython环境下的第一个闪灯实验,面包板接线情况参考如下。

image-20210724172122493

代码参考

1
2
3
4
5
6
7
8
9
10
11
from machine import Pin
import utime
count = 10
d5 = Pin(14,Pin.OUT)
while count > 0:
print("count", count)
d5.on()
utime.sleep(1)
d5.off()
utime.sleep(1)
count = count - 1

image-20210724172434483

image-20210724172457611