Hey guys,
Wondering if anyone has any experience with APA104? Just wondering if I’m stupid, my LEDs are faulty or it’s just a glitch as they’re in beta with FASTled still I think.
My leds are not doing what I’d expect at all, when I use the code below to make one white led travel the wire it does so but the rest of the leds flash random colours on and off. After that I tried just flashing one LED red (after making the code GRB rather than RGB) it’s red but it flashes kind of yellow as well and the next led sometimes comes on and just kind of stays on.
My copy of the first light code that is flashing randomly:
#include “FastLED.h”
///////////////////////////////////////////////////////////////////////////////////////////
//
// Move a white dot along the strip of leds. This program simply shows how to configure the leds,
// and then how to turn a single pixel white and then off, moving down the line of pixels.
//
// How many leds are in the strip?
#define NUM_LEDS 150
// Data pin that led data will be written out over
#define DATA_PIN 2
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define CLOCK_PIN 8
// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];
// This function sets up the ledsand tells the controller about them
void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(2000);
FastLED.addLeds<APA104, DATA_PIN, RGB>(leds, NUM_LEDS);
}
// This function runs over and over, and is where you do the magic to light
// your leds.
void loop() {
// Move a single white led
for(int whiteLed = 0; whiteLed < NUM_LEDS; whiteLed = whiteLed + 1) {
// Turn our current led on to white, then show the leds
leds[whiteLed] = CRGB::White;
// Show the leds (only one of which is set to white, from above)
FastLED.show();
// Wait a little bit
delay(100);
// Turn our current led back to black for the next loop around
leds[whiteLed] = CRGB::Black;
}
}
And thankfully it’s an easy fix.