Built-in Libraries¶
When you run your Python code on a Firia Labs device, it has access to all the built-in libraries that are “baked into” the firmware.
Note
Actually the correct term for MicroPython libraries which are compiled into the core firmware is “frozen modules”. Unlike libraries you might later load onto the filesystem, these libraries won’t be visible with your file browser.
Device Specific Libraries¶
The documentation on this site has details on the Firia Labs specific modules which are built into each of our devices. These libraries provide access to the all the hardware capabilities, as well as some handy utility functions to support your creative coding needs!
- What’s Loaded on My Device?
You can use the REPL to explore the available Python libraries on your device.
Enter help(“modules”) on the REPL to see a list of available modules:
>>> help("modules")
__main__ ascii_art fulltest rebel_graphics
_bleio audiobusio gallery rotaryio
_pixelbuf audiocore gamepad rtc
...
You can dig a little deeper by importing a module and exploring its built-in docs as well:
>>> import audiocore
>>> help(audiocore)
object <module 'audiocore'> is of type module
__name__ -- audiocore
RawSample -- <class 'RawSample'>
WaveFile -- <class 'WaveFile'>
>>> help(audiocore.RawSample)
object <class 'RawSample'> is of type type
deinit -- <function>
__enter__ -- <function>
__exit__ -- <function>
sample_rate -- <property>
pitch -- <property>
Python, MicroPython, and CircuitPython¶
For core Python Language documentation, refer to the Python 3.4 standard documentation: https://docs.python.org/release/3.4.7/
- CodeBot CB2 is based on MicroPython
Docs for MicroPython built-in libraries: https://docs.micropython.org/en/latest/library/
- CodeBot CB3, CodeX, and CodeAIR are based on CircuitPython (which itself is based on MicroPython!)
Docs for CircuitPython built-in libraries: https://docs.circuitpython.org/en/latest/shared-bindings/index.html
For CodeX and CB3 use v6.1 docs
For CodeAIR use v9.1 docs