Hi People, i would like to use this great Library for running some APA102

(Igor Vlasic) #1

Hi People,
i would like to use this great Library for running some APA102 LEDS on my hexacopter (6 Arms)
The best solution for me would be cutting 6 Stripes with 10 Leds pro Stripe and glue it on copter arms.
The best wireing System would be if i use multiple strips in one Array.

I am using one arduino Micro and i am not shure how i can define 6 Data Pins and one Clock Pin on Micro for those strips.
Can i use Hardware SPI clock pin (15) and define pwm Pins as data Pins?

FastLED.addLeds<APA102, 3,15>(leds, 0, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, 5,15>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, 6,15>(leds, 2 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, 9,15>(leds, 3 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, 10,15>(leds, 4 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, 11,15>(leds, 5 * NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);

would this work?


(Daniel Garcia) #2

You can’t do this for hardware SPI. The Arduino Micro only uses hardware SPI on the ICSP header (see here https://www.arduino.cc/en/Main/ArduinoBoardMicro ) - FastLED will use software bit-banging to drive the output though - so the setup that you have should work. It’ll just be slower than using hardware SPI, but since you’re only going to be driving a total of 60 leds it should be fine.

(I would recommend testing this setup a bit before attaching everything to the copter, however :slight_smile:

(There are some chipsets out there that FastLED supports, like the nrf51822 (used in the rfduino) and the upcoming LPC8xx, that allow you to map hardware SPI to any pair of pins that you want. Also the teensy 3.0/3.1 has a way to get 4 hardware SPI lines going)

There’s more info on hardware vs. software SPI here - https://github.com/FastLED/FastLED/wiki/SPI-Hardware-or-Bit-banging

(Also note - the sharing of clock lines as you’re doing here will only work with the APA102. With something like the WS2801 if you shared the clock line every time you wrote out a line of data to a single strip, all the other strips would behave as if they were passed a string of 0’s, blacking them out).

(Leon Yuhanov) #3

@Igor_Vlasic Your best bet is to hook up the strips in a daisy chain and create a mapped index array. then add a FastLED object.

(Daniel Garcia) #4

@Leon_Yuhanov that is only true if he’d like to use hardware SPI. However, FastLED’s bitbang’d SPI runs at about 2Mbps on the arduino hardware - which still puts it at about 2.5 times faster than WS2811 leds. Since there’s only 60 leds being written, there’s really no major loss to bitbanging the led output vs. using the hardware SPI.

The layout that @Igor_Vlasic has above should mostly work (as long as he is using APA102s). I’ve done similar things in past projects.

(Igor Vlasic) #5

Thnx a lot for your participation on this.
The Goal of whole Thing was to have a LED’s that are faster then WS2812B.
Thats why i ordered APA102.
Later on i saw that it would be great if i would not connect those 6 Stripes like a chain.
Ist just to much wires that i have to add in the System.
So I will give it a try with bitbang’d SPI.
It should still be faster then any WS2812B