#include <FastLED.h>
FASTLED_USING_NAMESPACE
// FastLED pattern tester for 4x50 LED strips
#if defined(FASTLED_VERSION) && (FASTLED_VERSION < 3001000)
#warning "Requires FastLED 3.1 or later; check github for latest code."
#endif
#define NUM_LEDS 50
CRGB leds[NUM_LEDS];
#define BRIGHTNESS 96
#define FRAMES_PER_SECOND 120
void setup() {
// tell FastLED about the LED strip configuration
// tell FastLED there's 50 WS2811 pixels on each of the four pins
FastLED.addLeds<WS2811, 3>(leds, NUM_LEDS);
// FastLED.addLeds<LED_TYPE,DATA_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
//FastLED.addLeds<LED_TYPE,DATA_PIN,CLK_PIN,COLOR_ORDER>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
// set master brightness control
FastLED.setBrightness(BRIGHTNESS);
}
uint8_t gHue = 208; // rotating "base color" used by many of the patterns
uint8_t gBPM = 100;
void loop()
{
// Call the test pattern function once, updating the 'leds' array
testPattern();
// send the 'leds' array out to the actual LED strip
FastLED.show();
// insert a delay to keep the framerate modest
FastLED.delay(1000/FRAMES_PER_SECOND);
}
#define ARRAY_SIZE(A) (sizeof(A) / sizeof((A)[0]))
// define the test pattern below
uint8_t pointer = 0;
void testPattern() {
// FastLED's built-in rainbow generator
fill_rainbow( leds, NUM_LEDS, gHue, 7);
}