#include <FastLED.h>
#define NUM_LEDS 45 /*the number of leds that will light. If */
//****************************
#define DATA_PINA 5 // Connect to the data wires on the pixel strips
CRGB ledsA[NUM_LEDS]; // sets number of pixels that will light on each strip.
CRGB ledsB[NUM_LEDS];
CRGB ledsC[NUM_LEDS];
//*****************************************************
void setup() {
FastLED.addLeds<WS2812B, DATA_PINA, GRB>(ledsA, NUM_LEDS);
}
//********************************************************
void loop() {
//BlinkRandomly();
RunLed();
ShowLetter();
DeleteLed();
}
//**************************************************
void fillStrip(int number, const struct CRGB &color) {
switch (number) {
case 1:
fill_solid(ledsA, NUM_LEDS, color);
break;
}
FastLED.show();
}
//**************************************************
void BlinkRandomly() {
int delayTime = random(25, 200); // sets the blink rate in milliseconds
int stripIndex = random(1, 4);
fillStrip(stripIndex, CRGB::Red);
delay(delayTime);
fillStrip(stripIndex, CRGB::Black);
delay(delayTime);
}
void RunLed() {
for (int i=0; i<=NUM_LEDS; i++) {
ledsA[i] = CRGB::Red;
FastLED.show();
delay(100);
}
}
void DeleteLed() {
for (int i=NUM_LEDS; i>=0; i--) {
ledsA[i] = CRGB::White;
FastLED.show();
delay(100);
}
}
void ShowLetter() {
ledsA[9] = CRGB::Green;
ledsA[13] = CRGB::Green;
ledsA[16] = CRGB::Green;
ledsA[17] = CRGB::Green;
ledsA[18] = CRGB::Green;
ledsA[19] = CRGB::Green;
ledsA[20] = CRGB::Green;
ledsA[39] = CRGB::Green;
ledsA[43] = CRGB::Green;
FastLED.show();
delay(1000);
}