installing micropython on esp32 in resources
This commit is contained in:
parent
28a443fdd6
commit
15d1b548d0
BIN
resources/ESP32_GENERIC-20240602-v1.23.0.bin
Normal file
BIN
resources/ESP32_GENERIC-20240602-v1.23.0.bin
Normal file
Binary file not shown.
73
resources/README.md
Normal file
73
resources/README.md
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# 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.
|
BIN
resources/RPI_PICO_W-20240602-v1.23.0.uf2
Normal file
BIN
resources/RPI_PICO_W-20240602-v1.23.0.uf2
Normal file
Binary file not shown.
Binary file not shown.
@ -18,6 +18,7 @@ Outputs:
|
|||||||
|
|
||||||
* Neopixels (light)
|
* Neopixels (light)
|
||||||
* Mini speaker
|
* Mini speaker
|
||||||
|
* GPIO
|
||||||
|
|
||||||
Communications:
|
Communications:
|
||||||
|
|
||||||
@ -33,6 +34,7 @@ Sensors:
|
|||||||
* infra-red proximity
|
* infra-red proximity
|
||||||
* slide switch
|
* slide switch
|
||||||
* 2 x push buttons
|
* 2 x push buttons
|
||||||
|
* ADC
|
||||||
|
|
||||||
Controller:
|
Controller:
|
||||||
|
|
||||||
@ -50,3 +52,10 @@ Power:
|
|||||||
The CPX provides a great introduction into planning and trying out systems, because it has a lot packed into it, with one exception. It is not good at communications/networking, as it has no buil-in radio or ethernet connection.
|
The CPX provides a great introduction into planning and trying out systems, because it has a lot packed into it, with one exception. It is not good at communications/networking, as it has no buil-in radio or ethernet connection.
|
||||||
|
|
||||||
In this scenario, it is most common to team up the controller with another device that does have communications capability, such as a single-board computer. The CPX can communicate by serial through the USB port, and the SBC can then handle networking and communications (as we did with our MQTT experiments the previous month.)
|
In this scenario, it is most common to team up the controller with another device that does have communications capability, such as a single-board computer. The CPX can communicate by serial through the USB port, and the SBC can then handle networking and communications (as we did with our MQTT experiments the previous month.)
|
||||||
|
|
||||||
|
Resources:
|
||||||
|
|
||||||
|
CPX Guided Tour
|
||||||
|
https://learn.adafruit.com/adafruit-circuit-playground-express/guided-tour
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user