MicroPython ESP32 blink 示例
此 MicroPython 代码闪烁 GPIO2,它连接到大多数 ESP32 板上的 LED。
esp32_blink.py
import machine
import time
led = machine.Pin(2, machine.Pin.OUT)
while True:
led.value(1)
time.sleep(1)
led.value(0)
time.sleep(1)不知道如何将文件上传到 MicroPython 以便在启动时自动运行?
- 要通过 USB 刷写,请参见如何通过 USB/串口上传文件到 MicroPython
- 要通过网络刷写(已启用 WebREPL),请参见如何使用 webrepl_cli.py 通过 WebREPL 上传文件到 MicroPython
Check out similar posts by category:
Embedded, MicroPython, Python
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow