HI, wondering if anyone can help.

HI, wondering if anyone can help.

I want to run two APA102 strips off the same controller, but I want to use different data/clock pins as I wish to run them as independent strips, off their own digital i/o pins.

I have the following code, but I realised that perhaps I cannot define more than one data/clock pin using FastLED. Is this possible?

#include “FastLED.h”

#define NUM_LEDS 27
#define DATA_PIN 0
#define CLOCK_PIN 1
#define DATA_PIN2 2
#define CLOCK_PIN2 3
CRGB leds[NUM_LEDS];

void setup() {

FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS);
FastLED.addLeds<APA102, DATA_PIN2, CLOCK_PIN2, BGR>(leds, NUM_LEDS);
FastLED.setBrightness(180);

}

It’s fine, but you might want to look at the MultipleStripsInOneArray example as you’ve not quite setup the led arrays correctly :wink:

CRGB leds[NUM_STRIPS * NUM_LEDS_PER_STRIP];

FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS_PER_STRIP);
FastLED.addLeds<APA102, DATA_PIN2, CLOCK_PIN2, BGR>(leds, NUM_LEDS_PER_STRIP, NUM_LEDS_PER_STRIP);

Okay, thanks!

I will give it a go tomorrow at college. I am attempting to interlace two strips showing every other online of an image from two predefined arrays (that contain every other line manually sorted beforehand).

Will be in POV globe. I have one strip already working, but would like the second for more resolution vertically.

If this works can I add more strips again in the same way?

Yes you can add more strips if you’ve got enough memory and pins

Hi, thanks again for your advice.
I have successfully got my strips to work with the above code.

I am now struggling to cause a delay to the second strip (so that they are synchronised when I spin them)

Is it possible to add a delay?? I tried to follow the advice in the multiple controllers example, but am struggling to write the correct usage into my code properly.

Examples:

My code:

void pushImage(unsigned long time, const unsigned int array[]){
unsigned long currentTime = millis();
while (millis()< currentTime + (time)) {

int f= numberOfSlices; // counter for ‘horizontal’ LED (strip is spinning)
int z; // Counter for which vertical LED
int j=NUM_LEDS; // total num of LEDs in strip

for (int x=0;x<f;x++){
 for(z=NUM_LEDS;z>0;z--){
   leds[z-1]=array[x+((j-z)*f)];}
 FastLED.show();
 delayMicroseconds(335);
 } 
 }

}

Glad the strips are working :slight_smile:
I’ve never done any POV stuff, I’ll think about it…