MicroPython
"MicroPython is a lean and efficient implementation of the Python 3 programming language that includes a small subset of the Python standard library and is optimised to run on microcontrollers and in constrained environments."- https://micropython.org
Hardware
Tips
screen /dev/usb.whatever
can sometimes not work to get a usb repl Try usingpicocom
instead.
ESP8266 workflow
- Info on flashing can be found here: https://docs.micropython.org/en/latest/esp8266/tutorial/intro.html
brew install picocom
pip install --user adafruit-ampy esptool
export AMPY_PORT=/dev/tty.usbserial-0001
sets upampy
with the needed sieral port.ampy run test.py
run test.py found in the current local directory on the ESP8266.ampy --port /serial/port put test.py /foo/bar.py
copy a file to the board. Useget
to copy the other way. Omit destination file name to just view the file.- Modify boot.py for any boot setup. Run
ampy get boot.py
to see the defaults for the flash you have loaded. - Modify main.py with your main program code to auto-run.
Links
- My microcontrollers notes have more info about LED projects and associated hardware.
- https://docs.micropython.org
- https://www.digikey.com/en/maker/projects/micropython-basics-load-files-run-code/fb1fcedaf11e4547943abfdd8ad825ce
- TalkPython.fm Episode #108: MicroPython and Open Source Hardware at Adafruit
- https://github.com/scientifichackers/ampy
- https://youtu.be/odffCT0aW58: Tutorial on how to use Jupyter as a micropython development interface for neopixels