CircuitPython is a programming language based on Python, one of the fastest growing programming languages in the world. It is specifically designed to simplify experimenting and learning to code on low-cost microcontroller boards. Here is a guide which covers the basics:
Be sure you have the latest CircuitPython for your board loaded onto your board, as described here. You will want at least version 4.1 (possibly a beta version of it) for maximum graphics performance. While we'll reference the PyPortal in this guide, but this will work on all of the TFT based CircuitPython boards such as PyBadge and PyGamer.
CircuitPython is easiest to use within the Mu Editor. If you haven't previously used Mu, this guide will get you started.
Libraries
Plug your board into your computer via a USB cable. Please be sure the cable is a good power+data cable so the computer can talk to the board.
A new disk should appear in your computer's file explorer/finder called CIRCUITPY. This is the place we'll copy the code and code library. If you can only get a drive named PORTALBOOT or PYGAMERBOOT, load CircuitPython per the guide mentioned above.
Create a new directory on the CIRCUITPY drive named lib.
Download the latest CircuitPython driver package to your computer using the green button below. Match the library you get to the version of CircuitPython you are using. Save to your computer's hard drive where you can find it.
With your file explorer/finder, browse to the bundle and open it up.
For a PyBadge or PyGamer
Copy the following folders and files from the library bundle to your CIRCUITPY lib directory you made earlier:
- adafruit_cursorcontrol
- adafruit_debouncer.mpy
- adafruit_logging.mpy
Your CIRCUITPY/lib directory should look like the snapshot below.
For a PyPortal
Copy the following folders and files from the library bundle to your CIRCUITPY lib directory you made earlier:
- adafruit_logging.mpy
- adafruit_touchscreen.mpy
Your CIRCUITPY/lib directory should look like the snapshot below.
All of the other necessary libraries are baked into CircuitPython!
Text editor powered by tinymce.