u/FireQuartzZz

Speeding up FastLED.show() function for pov project

Hi I'm using trying to create a pov display but I'm struggeling with getting my loop fast enough. Currently my code loop takes around 2100us, just the FastLED.show() takes 1800us is this to be expected or can I get this down to around 500us? I have this test code just for tracking down why it takes so long but I havent found any way to get it below 1500us. Do you guys have any suggestions of what I could do to speed it up?

Hardware:
Mcu: TENSTAR esp32 s3 zero
Leds: two strips of hd107 with 70 leds each

Main.cpp

#include <FastLED.h>
#define LED_PIN_1     6
#define LED_PIN_2     7
#define CLOCK_PIN     8
#define NUM_LEDS      70
#define LED_TYPE    HD107HD
#define COLOR_ORDER BGR

CRGB leds1[NUM_LEDS];
CRGB leds2[NUM_LEDS];

void setup() {
  FastLED.addLeds<LED_TYPE, LED_PIN_1, CLOCK_PIN, COLOR_ORDER>(leds1, NUM_LEDS);
  FastLED.addLeds<LED_TYPE, LED_PIN_2, CLOCK_PIN, COLOR_ORDER>(leds2, NUM_LEDS);
  Serial.begin(115200);
}

void loop() {
  int t1 = micros();
  FastLED.show();
  int t2 = micros();
  Serial.println(t2-t1);
}

Platformio.ini

[env:esp32-s3]
platform = Espressif32
board = adafruit_feather_esp32s3
framework = arduino
monitor_speed = 115200
lib_deps = 
    FastLED@^3.10.3
reddit.com
u/FireQuartzZz — 8 days ago