Skip to main content

Driving Dotstar LED strips (APA102)

The Dotstar LEDs (APA102) are similar to the NeoPixels but with less timing and other requirements. 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 regular Neopixel ones.

For a quick test we cobbled together a series of scripts that at least get some light effects out of a Dotstar strip, starting out from MicroPython. You will need the micropython_dotstar library that you can find here: https://github.com/mattytrentini/micropython-dotstar. We changed one thing however, which is to set the auto_write to False instead of True. When set to True, the program will wait until all leds are set before updating the entire strip at once. When set to False, each LED is updated individually.

Which mode you need will depend on your use case, we set it to False to allow for faster lighting effects with longer strips. For strips up to ~10 LEDs you will hardly notice the difference.