Adafruit DotStar SPI LED Strip Library [Ported]


#1

Hey Gang!

If you are staying tuned into the world of Sparkly stuff, Adafruit just released a new product called DotStar that is the successor to the NeoPixel. The TL;DR: they are SPI controlled (2-wire) instead of the asynchronous variable bit width (1-wire), and have a much faster refresh rate on the PWM controller. That combined with the fast serial protocol make them perfect for POV displays and smooth lighting for light painting projects!

It’s new new new… so I ordered a 60-pixel black strip to play with. Bunch of different types here:
https://www.adafruit.com/search?q=dotstar

I also ported the Adafruit DotStar Library for the Spark Core and Photon this morning (Update: all Particle devices are supported now). Made sure everything looked like it was working from my logic analyzer running on a Spark Core (as compared to Arduino UNO). It supports Hardware and Software SPI. NeoPixel examples should be compatible, just make sure to name your base Class object instance the same (i.e. “strip”).

This DotStar library is currently published and available in the Particle Libraries which can be used in the Web IDE. Log in and you should be able to see this. If not just search for “dotstar”.
https://build.particle.io/libs/dotstar/0.0.5/tab/example/1-strandtest.cpp

That’s all… now let’s see your crazy awexome projects! :slight_smile:


Using the WS2812
#2

Cooler than a snoman’s cold bits! :snowman:


#3

Got my DotStar strip today, and the proof that it works is in the pudding (oh wait I ate the pudding)… the proof is in the fact that I’m now blind from sparkly stuff.

Here’s my first DotStar project share:

The only thing that was wrong with the library was the Blue and Green colors were swapped, but that’s the way I got it from Adafruit… easy to fix though. I’ll have to submit a Pull Request for them, and rev the submitted Spark library to v0.0.2. Will update again when that happens.


#4

v0.0.2 is published in Spark Libraries with Adafruit’s R/G/B pixel order changes:
https://build.particle.io/libs/56247fe4eef6db92ae000c69/tab/1-strandtest.cpp


#5

v0.0.3 is published in Particle Libraries and now supports Core/Photon/P1/Electron:
https://build.particle.io/libs/56247fe4eef6db92ae000c69/tab/1-strandtest.cpp


#6

@BDub
Thanks for fixing this library but now I’m more confused than before. At the time while the library was brocken in the web ide I tried some work arounds on your git repo and particle-cli and it doesn’t work(the flashing and building succeded but not the program). So I thought I’m blind to find the error. Now I’m building the example with the web ide andwith the new version all works fine. With the particle-cli and your repo it doesn’t work. Can you give me a hint why this is working with flashing from web ide and not with particle-cli?


#7

It’s probably related to how the files are organized for Particle Libaries vs. how they need to be organized for the CLI. If you clone locally, you need to create a folder, and put the Dotstar.cpp and Dotstar.h in there, then copy just one example file in there as well (some libraries have multiple examples). In the example, change the #include “dotstar/dotstar.h” to just #include “dotstar.h”. Then back out of that directory and type:

particle flash my_photon_name directory_of_3_files

#8

Thanks that is working. Ok I was thinking different but now is the question. Is there a way to have libraries in other folders and including them like

#include “…/Particle-DotStar/firmware/dotstar.h” or as subfolder #include “Particle-DotStar/firmware/dotstar.h”


Sorry I’m blind! I should read particle-cli documentation. For those who search the solution too:
https://docs.particle.io/reference/cli/#example-particle-include


#9

Just updated the DotStar library to fix a bug and also added support the RedBear Duo device :grin:

Important:

If you have an old app in Build that you are migrating to a Particle Photon, P1, Electron, Spark Core or RedBear Duo please remove the DotStar library from your app and re-apply it to update the included library to v0.0.4. If you are creating a new app, simply add the DotStar library to your app and you will have the latest v0.0.4.

Live in the Particle Libraries - DotStar v0.0.4

https://build.particle.io/libs/577064b9d4a03cf59c0003e0/tab/1-strandtest.cpp

Changelog v0.0.3 to v0.0.4:

  • fixed a bug with some functions like setBrightness and clear not being available due to use of inline.
  • added support for the RedBear Duo device

#10

Just updated the DotStar library to add support for Particle Mesh devices Argon, Boron and Xenon!

Important:

If you have an old app that you would like to update please remove the DotStar library from your app and re-apply it to update the included library to v0.0.5. If you are creating a new app, simply add the DotStar library to your app and you will have the latest v0.0.5.

Live in the Particle Libraries - DotStar v0.0.5

https://build.particle.io/libs/dotstar/0.0.5/tab/example/1-strandtest.cpp