# DotStar SPI class for Processing for Pi

**URL:** <https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619>\
**Category:** Processing for Pi\
**Created:** [March 12, 2020, 12:18pm UTC](https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619 "2020-03-12T12:18:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bluemoon](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bluemoon](https://discourse.processing.org/u/bluemoon)\
**Post date:** [March 12, 2020, 12:18pm UTC](https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619/1 "2020-03-12T12:18:55Z")

</div>

Hi folks,

I made a class to control DotStar LEDs over SPI with Processing for Pi. I don’t have the proper chops to make an actual Java library, so I just put together some sample code. With it you can control an LED strip with the raspberry pi hardware SPI and set individual LED colors or fill the whole strip with one color. I hope it’s useful to others. You can find the [sample code on github.](https://github.com/mbmosher/RPi-DotStar-SPI)

---

<div class="post-metadata">

**Author:** ![jeremydouglass](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/jeremydouglass/32/20_2.png) [@jeremydouglass](https://discourse.processing.org/u/jeremydouglass)\
**Post date:** [March 17, 2020, 6:53pm UTC](https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619/2 "2020-03-17T18:53:44Z")

</div>

Hi @bluemoon – thank you so much for sharing this work!

> [@bluemoon](#):
>
> I don’t have the proper chops to make an actual Java library, so I just put together some sample code.

We could help you package your DotStar class as a library and release it from your repo – however you would need to be able to maintain it as a library once it was so-packaged. This would mean using Eclipse or NetBeans to edit it as Java once it was set up and built. Does that sound like something you would want to do?

---

<div class="post-metadata">

**Author:** ![bluemoon](https://avatars.discourse-cdn.com/v4/letter/b/bc79bd/32.png) [@bluemoon](https://discourse.processing.org/u/bluemoon)\
**Post date:** [March 18, 2020, 8:30pm UTC](https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619/3 "2020-03-18T20:30:55Z")

</div>

Hey Jeremy, Thanks so much for the assistance offer, but unfortunately this is just what I don’t know how to do - use ecyplse or netbeans.

---

<div class="post-metadata">

**Author:** ![monkstone](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/monkstone/32/64_2.png) [@monkstone](https://discourse.processing.org/u/monkstone)\
**Post date:** [March 20, 2020, 8:40pm UTC](https://discourse.processing.org/t/dotstar-spi-class-for-processing-for-pi/18619/4 "2020-03-20T20:40:27Z")

</div>

@bluemoon One little tip to get you started is to convert the processing code to java. The processing pre-processor does this for you, but most people don’t know that when you run the sketch the java code is stored in your `/tmp` directory. If you look at the `/tmp` directory you will find two folders `RPI_DotStar_SPI...` one contains the java class but the other pre-compiled java file.
