I have a sketch using FastLED version 3.000.002 on Adafruit DotStar LED Strip -

I have a sketch using FastLED version 3.000.002 on Adafruit DotStar LED Strip - APA102 Warm White (Adafruit DotStar LED Strip - Addressable Warm White - 30 LED/m [~3000K] : ID 2435 : $99.75 : Adafruit Industries, Unique & fun DIY electronics and kits). The code I have just lowers and raises the brightness (turning off and on by fading). It works on my test strip of 14 leds, but when I move to a strip of 134 it is super slow and choppy. Here is the code I have that runs on the 14 led strip.

#include <FastLED.h>
#include <SPI.h>

#define NUM_LEDS 134

//First strained
#define DATA_PIN 5 // Green
#define CLOCK_PIN 6 // Blue

CRGB leds[NUM_LEDS];

void setup() {
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN>(leds, NUM_LEDS);
Serial.begin(9600);
FastLED.show();
}

void loop() {
lightsOn();
Serial.println(“lights on”);
delay(2000);
lightsOff();
Serial.println(“lights off”);
delay(2000);

}

// function fading lights on
void lightsOn() {
int lightsOnMaxBrightness = 64;
int lightsOnMinBrightness = 2;

for (int i = lightsOnMinBrightness; i < lightsOnMaxBrightness; i++) {
lightsOnMinBrightness = i;
for ( int j = 0; j < NUM_LEDS; j++) {
leds[j] = CRGB(lightsOnMinBrightness);
FastLED.show();
}
}
}

void lightsOff() {
int lightsOffMaxBrightness = 64;
int lightsOffMinBrightness = 2;

for (int i = lightsOffMaxBrightness; i > lightsOffMinBrightness; i–) {
lightsOffMaxBrightness = i;
for ( int j = 0; j < NUM_LEDS; j++) {
leds[j] = CRGB(lightsOffMaxBrightness);
FastLED.show();
}
}
}

I appreciate any help!

Move your call to FastLED.show() out of the inner loop. You don’t need to call FastLED.show after changing every led - you just need to call it after updating all the leds

You are a wizard sir! Worked like a charm and thank you so much!!!

For anyone else trying to do this here is the updated code.

#include <FastLED.h>

#define NUM_LEDS 134

//First strained
#define DATA_PIN 5 // Green
#define CLOCK_PIN 6 // Blue

CRGB leds[NUM_LEDS];

void setup() {
FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN>(leds, NUM_LEDS);
Serial.begin(9600);
FastLED.show();
}

void loop() {
lightsOn();
Serial.println(“lights on”);
delay(2000);
lightsOff();
Serial.println(“lights off”);
delay(2000);

}

// function fading lights on
void lightsOn() {
int lightsOnMaxBrightness = 64;
int lightsOnMinBrightness = 2;

for (int i = lightsOnMinBrightness; i < lightsOnMaxBrightness; i++) {
lightsOnMinBrightness = i;
FastLED.show();
for ( int j = 0; j < NUM_LEDS; j++) {
leds[j] = CRGB(lightsOnMinBrightness);
}
}
}

void lightsOff() {
int lightsOffMaxBrightness = 64;
int lightsOffMinBrightness = 2;

for (int i = lightsOffMaxBrightness; i > lightsOffMinBrightness; i–) {
lightsOffMaxBrightness = i;
FastLED.show();
for ( int j = 0; j < NUM_LEDS; j++) {
leds[j] = CRGB(lightsOffMaxBrightness);
}
}
}

Glad you got it working. I’d suggest instead of pasting code in posts and comments here, post it on https://gist.github.com or http://pastebin.com, which are free, and make it much easier to read, copy, etc.