# Adafruit DotStar SPI LED Strip Library \[Ported\]

**URL:** <https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999>\
**Category:** Libraries\
**Created:** [December 27, 2014, 7:57pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999 "2014-12-27T19:57:36Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [December 27, 2014, 7:57pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/1 "2014-12-27T19:57:37Z")

</div>

Hey Gang!

If you are staying tuned into the world of Sparkly stuff, Adafruit just released a new product called [DotStar](https://learn.adafruit.com/adafruit-dotstar-leds) 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!

![](https://community.particle.io/uploads/particle/3966/1bf44ba5acdf9450.jpg)

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](https://www.adafruit.com/search?q=dotstar)

I also ported the [Adafruit DotStar Library](https://github.com/adafruit/Adafruit_DotStar) for the [Spark Core and Photon](https://store.spark.io) 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”).

> **[technobly/Particle-DotStar](https://github.com/technobly/Particle-DotStar)**
>
> An Implementation of Adafruit's DotStar Library for the Spark Core - technobly/Particle-DotStar

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](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! 🙂

---

<div class="post-metadata">

**Author:** ![mdma](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mdma/32/1924_2.png) [@mdma](https://community.particle.io/u/mdma)\
**Post date:** [December 28, 2014, 8:35am UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/2 "2014-12-28T08:35:28Z")

</div>

Cooler than a snoman’s cold bits! ☃

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [January 1, 2015, 5:40am UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/3 "2015-01-01T05:40:27Z")

</div>

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:

> **[Spark Core Adafruit DotStar 60-LED Strip New Year's Eve Countdown!](https://community.particle.io/t/spark-core-adafruit-dotstar-60-led-strip-new-years-eve-countdown/9076)**
>
> Just got my Adafruit DotStar strip today and coded up a nice NYE Countdown Timer for it. Here’s the gist of it… You need a 60 pixel DotStar LED strip. NeoPixel will work if you can hurry up and fix the includes at the top. Hang it up with the...

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](https://github.com/adafruit/Adafruit_DotStar/pull/1) for them, and rev the submitted Spark library to v0.0.2. Will update again when that happens.

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [January 2, 2015, 4:45am UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/4 "2015-01-02T04:45:35Z")

</div>

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](https://build.particle.io/libs/56247fe4eef6db92ae000c69/tab/1-strandtest.cpp)

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [October 19, 2015, 2:58pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/5 "2015-10-19T14:58:47Z")

</div>

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](https://build.particle.io/libs/56247fe4eef6db92ae000c69/tab/1-strandtest.cpp)

---

<div class="post-metadata">

**Author:** ![StuttVoll](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@StuttVoll](https://community.particle.io/u/StuttVoll)\
**Post date:** [October 19, 2015, 9:14pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/6 "2015-10-19T21:14:07Z")

</div>

@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?

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [October 19, 2015, 9:26pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/7 "2015-10-19T21:26:30Z")

</div>

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:

```auto
particle flash my_photon_name directory_of_3_files

```

---

<div class="post-metadata">

**Author:** ![StuttVoll](https://avatars.discourse-cdn.com/v4/letter/s/aeb1de/32.png) [@StuttVoll](https://community.particle.io/u/StuttVoll)\
**Post date:** [October 19, 2015, 9:49pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/8 "2015-10-19T21:49:01Z")

</div>

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](https://docs.particle.io/reference/cli/#example-particle-include)

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [June 26, 2016, 11:38pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/9 "2016-06-26T23:38:20Z")

</div>

### Just updated the DotStar library to fix a bug and also added support the [RedBear Duo](https://github.com/redbear/Duo) device 😁

### 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](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](https://github.com/redbear/Duo) device

---

<div class="post-metadata">

**Author:** ![BDub](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/bdub/32/5137_2.png) [@BDub](https://community.particle.io/u/BDub)\
**Post date:** [December 22, 2018, 5:48pm UTC](https://community.particle.io/t/adafruit-dotstar-spi-led-strip-library-ported/8999/10 "2018-12-22T17:48:23Z")

</div>

### 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

> **[Particle Web IDE](https://build.particle.io/libs/dotstar/0.0.5/tab/example/1-strandtest.cpp)**
>
> Write and flash code to your Particle devices
