Strange question occured while migrating my code from a '328 Arduino to a Mega. I could only get the Mega running my demo code by adding this to my setup ahead of my “FastLED.addLeds” setup string:
LEDS.addLeds(leds, totalLEDs);
FastLED.addLeds<WS2801, dataPin, clockPin, RGB>(leds, totalLEDs);
I comment out the 1st line, and she stops. What’s the purpose of the LEDS.addLeds line (which I’m having a devil of a time pinning down).
Thx,
Dave
A couple of things LEDS and FastLED are aliases for the same thing, so it doesn’t matter which of those two you use.
Think of LEDS (or FastLED) as a master controller for all the LEDs that you are using. The addLeds lines tell the controller what kinds of strips you have, and on what pins, and what CRGB array to use for the data to send out to the LEDs.
What are the values for dataPin and clockPin? For spi based chipsets like the ws2801, if you don’t specify pins then it defaults to using the hardware defined spi pins. If you do specify the clock and data pins, one of two things happens. If the pins you specify happen to be the same pins as the clock and data pins, then it will use hardware spi. If not, then it will use the software spi.
What I suspect is happening (and this is a guess since I can’t see all of your code) is that the dataPin and clockPin values don’t line up tot he data and clock pin that your LEDs are plugged into, so nothing is happening on the LEDs.