CircuitPython Libraries
Each CircuitPython program you run needs to have a lot of information to work. The
reason CircuitPython is so simple to use is that most of that information is stored in
other files and works in the background. These files are called libraries. Some of them
are built into CircuitPython. Others are stored on your CIRCUITPY drive in a folder
called lib. Part of what makes CircuitPython so great is its ability to store code
separately from the firmware itself. Storing code separately from the firmware makes
it easier to update both the code you write and the libraries you depend.
Your board may ship with a lib folder already, it's in the base directory of the drive. If
not, simply create the folder yourself. When you first install CircuitPython, an empty lib
directory will be created for you.
CircuitPython libraries work in the same way as regular Python modules so the Python
docsī¤() are an excellent reference for how it all should work. In Python terms, you can
place our library files in the lib directory because it's part of the Python path by
default.
One downside of this approach of separate libraries is that they are not built in. To
use them, one needs to copy them to the CIRCUITPY drive before they can be used.
Fortunately, there is a library bundle.
As CircuitPython development continues and there are new releases, Adafruit
will stop supporting older releases. Visit https://circuitpython.org/downloads to
download the latest version of CircuitPython for your board. You must download
the CircuitPython Library Bundle that matches your version of CircuitPython.
Please update CircuitPython and then visit https://circuitpython.org/libraries to
download the latest Library Bundle.
©Adafruit Industries Page 62 of 263