The Circuit Playground Express, or CPX, and the Circuit Playground Bluefruit, or CPB, have all kinds of sensors, buttons, switches and LEDs built into them. To top it off, they work with CircuitPython. Normally, using CircuitPython with a button or sensor requires setup in your code. Sometimes this means one line of code. Other times, it can mean several. Wouldn't it be nice to be able to skip all of that and get right to work? We've got you covered. Whether you're new to programming CircuitPython, or would like a simple way to include the Circuit Playground functionality in your code, the Circuit Playground CircuitPython library is exactly what you're looking for.

We've designed a CircuitPython library that makes it super easy to get started with Circuit Playground Express and Bluefruit. All of the setup normally required for much of what is built into the CPX or CPB is done for you. All you need to do is import this library, and you can immediately begin to tell the board what to do. This guide will go through each feature available in the library and provide examples of how to use it.

For the purposes of this guide, we'll refer to the Circuit Playground Express and Circuit Playground Bluefruit as "Circuit Playground", as the majority of the code within works on both boards with no changes needed. Where necessary, it will be made explicitly clear that a particular section works with a specific board.

Most of the images are of the Circuit Playground Express because most of the features of the Express and Bluefruit are in the same location. Images of both are included when a feature is in a different location on the Bluefruit.

There's a few things you should do before going through this guide to make sure you're all set to go. Let's take a look!

This guide was first published on Jun 05, 2018. It was last updated on Jul 22, 2024.

This page (Circuit Playground Library) was last updated on Mar 08, 2024.

Text editor powered by tinymce.