Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Some basic FastLED animations by Chemdoc77
//Basic FastLED Aminations by Chemdoc77
#include <FastLED.h>
#define DATA_PIN 6
#define LED_TYPE NEOPIXEL
#define NUM_LEDS 24
CRGB leds[NUM_LEDS];
int brightness = 100;
void setup() {
delay(2000);
FastLED.addLeds<LED_TYPE, DATA_PIN>(leds, NUM_LEDS);
FastLED.setDither(false);
FastLED.setCorrection(TypicalLEDStrip);
FastLED.setBrightness(brightness);
FastLED.setMaxPowerInVoltsAndMilliamps(5, 1500);
set_max_power_indicator_LED(13);
fill_solid(leds, NUM_LEDS, CRGB::Black);
FastLED.show();
}
void loop() {
cd77_colorwipe_color_then_black(CRGB::Red, 50);
}
//==================== Functions ===============================
void cd77_colorwipe_color_then_black(CRGB color, uint16_t wait) {
for (uint16_t i = 0; i <NUM_LEDS; i++) {
leds[i] = color;
FastLED.delay(wait);
}
for (uint16_t i = 0; i <NUM_LEDS; i++) {
leds[i] = CRGB::Black;
FastLED.delay(wait);
}
}
void cd77_colorwipe(CRGB color, uint16_t wait) {
for (uint16_t i = 0; i <NUM_LEDS; i++) {
leds[i] = color;
FastLED.delay(wait);
}
}
void cd77_colorwipe_dot(CRGB color, uint16_t wait) {
for (uint16_t i = 0; i <NUM_LEDS; i++) {
leds[i] = color;
FastLED.delay(wait);
leds[i] = CRGB::Black;
FastLED.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.