Skip to content
master
Go to file
Code
This branch is 6 commits ahead, 8 commits behind technobly:master.

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 

README.md

Particle-DotStar Mod

This fork was made for people that have a need for speed.

The original library takes about 800us for 128 leds (hardware SPI), so this saves about 1ms. 800us is still very fast, so beginners better might use the original library.

People that start out with LEDs can better use the FastLED library which has better support, more functionality and other awesomeness: [FastLED] (http://fastled.io).

This fork has several changes.

SPI.transfer was modified in order to support build in DMA. This transfers the pixel data to the leds in the background, so you continue with upcoming calculations, see [Particle Reference] (https://docs.particle.io/reference/firmware/photon/#transfer-).

To do that the internal layout of the pixels array was changed.

setBrightness() now modifies the 5-bit brightness parameter of the DotStar leds. This is not the most optimimal, so again a reason for beginners to skip this. It's a number between 0-255 that will be scaled down to 0-31 (5-bit).

The software SPI part wasn't really changed (although it bitbangs the new layout)

If you'd like to use SPI use the following pins on the Photon:

  • A3 Clock
  • A5 Data

alternatively you can use SPI1:

  • D4 Clock
  • D2 Data

Hardware SPI calls:

Adafruit_DotStar strip = Adafruit_DotStar(NUM_LEDS); // SPI (A3/A5)
Adafruit_DotStar strip = Adafruit_DotStar(NUM_LEDS, DOTSTAR_BGR, 0); // SPI (A3/A5)
Adafruit_DotStar strip = Adafruit_DotStar(NUM_LEDS, DOTSTAR_BGR, 1); // SPI1 (D2/D4)

Original library text below

A library for manipulating DotStar RGB LEDs for the Spark Core, Particle Photon, P1 and Electron. Implementation based on Adafruit's DotStar Library.

DotStar LED's are APA102: Datasheet

Components Required

  • A DotStar digital RGB LED (get at adafruit.com)
  • A Particle Shield Shield or breakout board to supply DotStars with 5V (see store at particle.io)

Example Usage

Adafruit_DotStar strip = Adafruit_DotStar(NUMPIXELS, DATAPIN, CLOCKPIN);
void setup() {
  strip.begin();
  strip.show();
}
void loop() {
  // change your pixel colors and call strip.show() again
}

Nuances

  • Make sure get the # of pixels, clock and data pin numbers (SW SPI can be any pins, HW SPI can only be A3 (clock) & A5 (data))

  • DotStars require 5V logic level inputs and the Spark Core/Photon/P1/Electron only have 3.3V logic level digital outputs. Level shifting from 3.3V to 5V is necessary, the Spark Shield Shield has the TXB0108PWR 3.3V to 5V level shifter built in (but has been known to oscillate at 50MHz with wire length longer than 6"), alternatively you can wire up your own with a SN74HCT245N, or SN74HCT125N. These are rock solid.

Useful Links

About

An Implementation of Adafruit's DotStar Library for the Spark Core

Resources

License

Packages

No packages published

Languages

You can’t perform that action at this time.