FastLED 3.9.15
Loading...
Searching...
No Matches
Blink.ino
#include <Arduino.h>
#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 1
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define PIN_DATA. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both PIN_DATA and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#ifndef PIN_DATA
#define PIN_DATA 3
#endif // PIN_DATA
#define CLOCK_PIN 13
// Define the array of leds
void setup() {
Serial.begin(115200);
Serial.println("\n==============================================");
Serial.println(" BLINK.INO - Simple LED Blink Example");
Serial.println("==============================================\n");
// Uncomment/edit one of the following lines for your leds arrangement.
// ## Clockless types ##
FastLED.addLeds<NEOPIXEL, PIN_DATA>(leds, NUM_LEDS); // GRB ordering is assumed
Serial.println("✓ Blink setup complete - starting blink loop\n");
// FastLED.addLeds<SM16824E, PIN_DATA, RGB>(leds, NUM_LEDS); // RGB ordering (uses SM16824EController)
// FastLED.addLeds<SM16703, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1829, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1812, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1809, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1804, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<TM1803, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1903B, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS1904, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS2903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<UCS7604, PIN_DATA, GRB>(leds, NUM_LEDS); // 8-bit RGBW chipset (all platforms)
// FastLED.addLeds<UCS7604HD, PIN_DATA, GRB>(leds, NUM_LEDS); // 16-bit RGBW chipset (all platforms)
// FastLED.addLeds<WS2812, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2852, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2812B, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2812BV5, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical (newer V5 variant with tighter timing)
// FastLED.addLeds<WS2812BMiniV3, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical (same timing as V5)
// FastLED.addLeds<GS1903, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6812, PIN_DATA, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<SK6822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA106, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<PL9823, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SK6822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2813, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<APA104, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2811_400, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GE8822, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<GW6205_400, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886, PIN_DATA, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<LPD1886_8BIT, PIN_DATA, RGB>(leds, NUM_LEDS);
// ## Clocked (SPI) types ##
// FastLED.addLeds<LPD6803, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<LPD8806, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
// FastLED.addLeds<WS2801, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<WS2803, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<SM16716, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS);
// FastLED.addLeds<P9813, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<DOTSTAR, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<APA102, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
// FastLED.addLeds<SK9822, PIN_DATA, CLOCK_PIN, RGB>(leds, NUM_LEDS); // BGR ordering is typical
}
void loop() {
// Turn the LED on, then pause
for (int i = 0; i < NUM_LEDS; ++i) {
}
FastLED.show();
delay(500);
// Now turn the LED off, then pause
for (int i = 0; i < NUM_LEDS; ++i) {
}
FastLED.show();
delay(100);
}
void setup()
void loop()
#define NUM_LEDS
#define PIN_DATA
fl::CRGB leds[NUM_LEDS]
FL_DISABLE_WARNING_PUSH FL_DISABLE_WARNING_GLOBAL_CONSTRUCTORS CFastLED FastLED
Global LED strip management instance.
fl::CRGB CRGB
Definition crgb.h:25
void delay(u32 ms, bool run_async=true) FL_NOEXCEPT
Public delay wrapper that keeps bare Arduino delay() preferred after using fl::delay; while still all...
Definition delay.h:98
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:622
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:510
#define Serial
Definition serial.h:304