snipplets.dev/code/MicroPython/README.md

532 B

# ...
esptool.py --port /dev/ttyACM0 erase_flash
# ...
esptool.py --chip esp32s2 --port /dev/ttyACM0 write_flash -z 0x1000 ~/Downloads/LOLIN_S2_MINI-20240222-v1.22.2.bin
pip3 install rshell   #
pip3 install mpremote #

Выполнение кода

rshell --port /dev/ttyACM0 cat blink.py
import machine
import time

led = machine.Pin(15, machine.Pin.OUT)

led.on()
time.sleep(1)
led.off()
time.sleep(1)
mpremote exec 'exec(open("blink.py").read())'