// for: https://forum.arduino.cc/t/fastled-project-running-at-half-speed-it-seems/1021155
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 144
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 9
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS); // GRB ordering is typical
FastLED.setMaxPowerInVoltsAndMilliamps(5, 500);
pinMode (8, OUTPUT);
digitalWrite (8, HIGH);
pinMode (10, OUTPUT);
digitalWrite (10, LOW);
//FastLED.setMaxRefreshRate(0);
}
void loop() {
for (int i = 0; i < NUM_LEDS; i++) {
leds[i] = CHSV(i, 255, 255);
leds[i - 1] = CRGB::Black;
FastLED.show();
//FastLED.clear();
}
for (int i = NUM_LEDS; i > 0; i--) {
leds[i] = CHSV(i, 255, 255);
FastLED.show();
FastLED.clear();
}
}