Anyone using these and got it working with a Photon?
I’ve used lots of APA102 strips with Arduinos and all works well.
Tried the simple example(blink, from the online lib) on Photon but it appears to do nothing except randomly light a couple of LEDS when it starts up. I notice the code won’t compile if I use any led types with a clock pin - which is what these strips need. Non clock pin types compile ok.
The library notes that for all platforms ‘some examples won’t compile’ but it does not say which and I can find no
mention of this anywhere.
What are the exact features you need of the FastLED lib for your APA102 LEDs?
Since their protocol is rather close to what SPI does, you can take advantage of the DMA capabilities of that interface and it’s dead easy to run these LEDs off A3/A5 on the Particles.
If it helps, this is how I control my APA102 strips
#define LED_COUNT (600)
uint32_t AP102[LED_COUNT + (LED_COUNT/16 + 1) + (1)]; // LEDs + (at least 1 leadout clock bit per 2 LEDs) + (extra byte as lead in for next round)
uint8_t brightness = 31;
volatile bool dmaReady = true;
void cbDMA() {
dmaReady = true;
}
void setup() {
SPI.begin();
SPI.setClockSpeed(30, MHZ);
SPI.setBitOrder(MSBFIRST);
...
}
void loop() {
//memset((void*)AP102, 0, sizeof(AP102)); // to clear all pixels fast
// just a dummy sample to show how to set the pixels
for (int i=0; i < LED_COUNT; i++) {
AP102[i] = 0xE0 | b << 24 | g << 16 | r << 8 | brightness;
}
if (dmaReady) {
dmaReady = false;
SPI.transfer(AP102, NULL, sizeof(AP102), cbDMA); // use NULL for callback for sync operation
}
}