CircuitPython Installation of ESP32SPI
Library
You'll need to install the
Adafruit CircuitPython ESP32SPI
librar
y on your CircuitPython board.
First make sure you are running the
latest version of Adafruit CircuitPython
(https://
adafru.it/Amd)
for your board.
Next you'll need to install the necessary libraries to use the hardware--carefully follow
the steps to find and install these libraries from
Adafruit's CircuitPython library bundle
(https://adafru.it/uap)
. Our CircuitPython starter guide has
(https://adafru.it/ABU)
.
You can manually install the necessary libraries from the bundle:
adafruit_esp32spi
adafruit_requests.mpy
adafruit_bus_device
Before continuing make sure your board's lib folder or root filesystem has the adafrui
t_esp32spi, adafruit_requests.mpy, and adafruit_bus_device files and folders copied
over.
Next
make sure you are set up to connect to the serial console
(https://adafru.it/Bec)
CircuitPython Usage
Copy the following code to your code.py file on your microcontroller:
import
board
import
busio
from
digitalio
import
DigitalInOut
from
adafruit_esp32spi
import
adafruit_esp32spi
(
"ESP32 SPI hardware test"
)
esp32_cs
=
DigitalInOut(board.D13)
esp32_reset
=
DigitalInOut(board.D12)
esp32_ready
=
DigitalInOut(board.D11)
spi
=
busio.SPI(board.SCK, board.MOSI, board.MISO)
esp
=
adafruit_esp32spi.ESP_SPIcontrol(spi, esp32_cs, esp32_ready, esp32_reset)
•
•
•
©Adafruit Industries
Page 13 of 54