Hello, I have almost no experience with WS2812b light strips and the only guides I can find are for making multi row scrolling text while I am only looking to use one row. I am currently integrating a WS2812B light strip into a tradeshow display to showcase flow by making the light scroll and change colors at certain points. I have only been able to get a single LED point to scroll using an if statement for the LED # and I will need to have every 6th or so LED scrolling to better show flow.
I am using the fast LED library and my current code is attached.
I think what you want is for three out of each 6 LEDs to be RED and the rest to be BLACK. And you want the pattern to shift left. That means there are six different patterns.
#include <FastLED.h>
#define LED_PIN 5
#define NUM_LEDS 60
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
void setup()
{
FastLED.addLeds<WS2812B, LED_PIN, GRB> (leds, NUM_LEDS);
FastLED.setBrightness(50);
}
void loop()
{
// Each of the pattern positions
for (int shift = 0; shift < 6; shift++)
{
for (int dot = 0; dot < NUM_LEDS; dot++)
{
if (dot <= 30)
{
// Red side
if (((dot + shift) % 6) < 3) // Three dots of color
leds[dot] = CRGB::Red;
else // The rest are black
leds[dot] = CRGB::Black;
}
else // >30
{
// Blue side
if (((dot + shift) % 6) < 3)
leds[dot] = CRGB::Blue;
else
leds[dot] = CRGB::Black;
}
}
// All of the dots are full so show them
FastLED.show();
delay(30); // This sets the rate of motion
}
}