Now that you know what you're looking for, it's time to read through the import
statements. The first two,
built-in.
The next one,
neopixel
So, you would head over to the bundle zip you downloaded, and search for neopixel.
There is a neopixel.mpy file in the bundle zip. Copy it over to the lib folder on your CI
RCUITPY drive. The following one,
Follow the same process for adafruit_lis3dh, where you'll find adafruit_lis3dh.mpy,
and copy that over.
The fifth one is
usb_hid
built-in modules come first in the import list, but sometimes they don't! Don't assume
that everything after the first library is also a library, and verify each import with the
modules list to be sure. Otherwise, you'll search the bundle and come up empty!
The final two imports are not as clear. Remember, when
formatted like this, the first thing after the
library name is
adafruit_hid
When a library is a folder, you must copy the entire folder and its contents as it is in
the bundle to the lib folder on your CIRCUITPY drive. In this case, you would copy the
entire adafruit_hid folder to your CIRCUITPY/lib folder.
Notice that there are two imports that begin with
need to import more than one thing from the same library. Regardless of how many
times you import the same library, you only need to load the library by copying over
the adafruit_hid folder once.
That is how you can use your example code to figure out what libraries to load on
your CircuitPython-compatible board!
©Adafruit Industries
and
, are on the modules list above, so they're
time
board
, is not on the module list. That means it's your first library!
adafruit_lis3dh
, and it is in the modules list, so it is built in. Often all of the
from
. A search of the bundle will find an adafruit_hid folder.
, is also not on the module list.
statements are
import
is the library name. In this case, the
. Sometimes you will
adafruit_hid
Page 70 of 263
Need help?
Do you have a question about the ESP32-S3 and is the answer not in the manual?