/* flash 3 Pixel LED strips randomly version 2
www. steamtraininfo.com.
This sketch uses 3
WS2812B pixel strips.
*/
#include <FastLED.h>
#define NUM_LEDS 15 /*the number of leds that will light. If */
//****************************
#define DATA_PINA 8 // Connect to the data wires on the pixel strips
CRGB ledsA[NUM_LEDS]; // sets number of pixels that will light on each strip.
//*****************************************************
void setup() {
FastLED.addLeds<WS2812B, DATA_PINA, GRB>(ledsA, NUM_LEDS);
randomSeed(analogRead(A0)); /*sets the pin to create "static so the the initial LED to light is different
each time through the loop */
}
//********************************************************
void loop() {
Breathe();
}
//**************************************************
void fillStrip(int number, const struct CRGB &color) {
switch (number) {
case 1:
fill_solid(ledsA, NUM_LEDS, color);
break;
case 2:
fill_solid(ledsB, NUM_LEDS, color);
break;
case 3:
fill_solid(ledsC, NUM_LEDS, color);
break;
}
FastLED.show();
}
//**************************************************
void Breathe() {
fill_solid(ledsA, NUM_LEDS, CRGB::Red);
FastLED.show();
delay(200);
fill_solid(ledsA, NUM_LEDS, CRGB::Black);
FastLED.show();
delay(200);
}