2.4 KiB
MicroPython
Included here is the UF2 file necessary to flash a Raspberry Pi Pico W with MicroPython.
To use it:
- Unplug your RPI from USB
- Hold down the Bootsel button
- While holding down, connect USB
- Release Bootsel button
The Pico will appear as a drive on your system. Drag and drop the UF2 file onto the Pico drive - it will be reset with MicroPython installed.
You are ready to code!
ESP32 Wroom
It is possible to use the example with an ESP board by Espressive as well (tested with ESP32 Wroom)
Installing MicroPython on the ESP32 is slightly more complex, and requires the installation of "esptool", a python library that will allow you to flash a binary file to the board.
The steps include:
- Download the propery binary for the board
- Set up a virtual environment for Python
- Install esptool
- Identify the port the device is on
- Use esptool to flash the binary your downloaded to the board
Set up Virtual Environment
Setting up a virtual environment for Python is necessary because Python is now regularly used by the operating system. Accordingly, the OS will not typically allow packages to be installed by another package manager, otherwise critical packages could be overwritten. A virtual environment allows all package dependencies to be installed in a virtual location, protecting system Python packages.
python -m venv esptoolenv
Now you can activate the environment, which will allow us to install the tool (see below)
source esptoolenv/bin/activate
Install ESPTool
In the virutal environment you can use the pip installer to get the tool.
pip install esptool
Identify the port device is on
ls /dev/tty*
Flash the binary
esptool.py --chip esp32 --port /dev/ttyUSB0 write_flash -z 0x1000 ESP32_GENERIC-20240602-v1.23.0.bin
Deactivate the virtual environment
deactivate
You can now use your code editor (like Thonny) to connect to your device and write the python code you find here.
CircuitPython CPX (9.1.3)
Here is the UF2 file to flash CircuitPython to a CPX board.
To use it:
- Double-click the reset button
- Ring light will turn green
- Drive will appear to the operating system
- Drag the UF2 file to the board
- Board will reboot and show up as 'CIRCUITPY'
You are ready to code in CircuitPython!
In addition to the base CircuitPython code, Adafruit supplies a large number of additional code libraries to make getting started easier.