Driving APA102 (Dotstar) LED strips with Pico

The Dotstar LEDs (APA102) are similar to the NeoPixels but with less timing requirements and other issues. You control them with two pins instead of one, and they seem to be a bit less widely used probably because they're more expensive than the Neopixel ones.

For a quick test we cobbled together a series of scripts that get some light effects out of a Dotstar strip, starting out from CircuitPython. You will need the adafruit_dotstar library that you can find here: https://circuitpython.org/libraries (make sure you download the right library version for your version of circuitpython).

More info on Dotstar strips and matrices here, by Adafruit. Page 39 and on concerns Circuitpython.

Setup

Make sure your Pico has Circuitpython installed. Once you've done that, copy adafruit_dotstar to the lib folder and this effects.py to your Pico. Connect the pins of the Dotstar strip to your Pico: power to power (preferrably external power, see also here), CI (usually yellow) to pin 18 and DI (usually green) to pin 19.

Run the effects.py and your strip should light up, cycling through a couple of lighting effects.

effects.py

effects.py has a couple of settings on the top of the program.

Lines 23-115 define functions for the lighting effects, which are called in the main loop at 136.

APA.gif



Revision #16
Created 21 December 2023 09:56:19 by mikal
Updated 25 January 2024 11:17:55 by mikal