2000 LEDS APA102, super slow.

Status
Not open for further replies.
I've read every post on the topic of pushing high numbers of LEDs 10 times but must be missing something. I only have 2,000 LEDs and I can't get more than 6 frames per second. I'm using a Teensy 4.0 with APA102s on 26 pins for data & clock. I'm guessing FastLED.show() has to push 40K of data / second to get 6fps for 2000 LEDs and that's the max.

Any ideas?

Thanks!
 
Got frames per second for 2000 LEDs up from 4fps to 158fps -- problem solved.

I've read every post on the topic of pushing high numbers of LEDs 10 times but must be missing something. I only have 2,000 LEDs and I can't get more than 6 frames per second. I'm using a Teensy 4.0 with APA102s on 26 pins for data & clock. I'm guessing FastLED.show() has to push 40K of data / second to get 6fps for 2000 LEDs and that's the max.

Any ideas?

Thanks!

I did some testing and thought I would post the results.


I tested sending data with FastLED[].showLeds() and FastLED.show(), sending the same amount of data to the same number of strips. The results are interesting and vary from 4fps to 158 fps depending on the approach. I made 6 strands to get more LEDs to increase the effect. It's odd to me that on the esp32 I see the same number of LEDs written at 11fps using FastLED.show() and 56fps using FastLED.showLeds() once for every strand. On the teensy it's the same which is what you would expect since it's the same amount of data being written.

I hope this is useful to someone.


The code I used to test:

// performance of FastLED.show() verses FastLED[1].showLeds()
// FastLED.show() 1728 LEDs 11 FPS on Huzzah ESP32 158 on Teensy 4.0
// FastLED[].showLeds(); 1728 LEDs 56 FPS on Huzzah ESP32 158 on Teensy 4.0




#include "FastLED.h"

#define NUM_LEDS 133
CRGB leds1[NUM_LEDS];
CRGB leds2[NUM_LEDS];
CRGB leds3[NUM_LEDS];
CRGB leds4[NUM_LEDS];
CRGB leds5[NUM_LEDS];
CRGB leds6[NUM_LEDS];

uint8_t gBrightness = 255;

int loops = 0;
unsigned long begining = millis();


void setup() {
Serial.begin(115200);
FastLED.addLeds<APA102, 13, 12, BGR>(leds1, NUM_LEDS);
FastLED.addLeds<APA102, 18, 19, BGR>(leds2, NUM_LEDS);
FastLED.addLeds<APA102, 17, 21, BGR>(leds3, NUM_LEDS);
FastLED.addLeds<APA102, 32, 15, BGR>(leds4, NUM_LEDS);
FastLED.addLeds<APA102, 33, 18, BGR>(leds5, NUM_LEDS);
FastLED.addLeds<APA102, 32, 16, BGR>(leds6, NUM_LEDS);

FastLED.clear();
FastLED.show();
}

void loop() {

loops++;
if ((millis() - begining ) >= 1000 ) {
Serial.printf("FPS: %d\n", loops);
begining = millis();
loops = 0;
}
leds1[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
leds2[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
leds3[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
leds4[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
leds5[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
leds6[random(1,64)].setRGB(random(0,128), random(0,128),random(0,128)); // turn some random leds on
//FastLED.show(); // comment the above lines and uncomment this line to test
FastLED[0].showLeds();
FastLED[1].showLeds();
FastLED[2].showLeds();
FastLED[3].showLeds();
FastLED[4].showLeds();
FastLED[5].showLeds();

for (int i = 0; i <= NUM_LEDS/2; i++) { // set half of the leds off at random
leds1[random(1,64)] = CRGB::Black;
}
}
 
Status
Not open for further replies.
Back
Top