As I stated, I'm not a programmer, I'm a hacker at minimum. So my sketch is probably garbage & much better ways to do it. And there is probably stuff in it I tried that didnt work, but I didnt remove it.
// Use if you want to force the software SPI subsystem to be used for some reason (generally, you don't)
// #define FASTLED_FORCE_SOFTWARE_SPI
// Use if you want to force non-accelerated pin access (hint: you really don't, it breaks lots of things)
// #define FASTLED_FORCE_SOFTWARE_SPI
// #define FASTLED_FORCE_SOFTWARE_PINS
#include <FastLED.h>
//
// Move a white dot along the strip of leds. This program simply shows how to configure the leds,
// and then how to turn a single pixel white and then off, moving down the line of pixels.
//
// How many leds are in the strip?
#define NUM_LEDS 138
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define DATA_PIN 2
#define CLOCK_PIN 13
// This is an array of leds. One item for each led in your strip.
CRGB leds[NUM_LEDS];
// This function sets up the ledsand tells the controller about them
void setup() {
// sanity check delay - allows reprogramming if accidently blowing power w/leds
delay(2000);
FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS); // GRB ordering is typical
}
// This function runs over and over, and is where you do the magic to light
// your leds.
void loop() {
int PauseDelay=rand() % 30;
int StartLED = rand() % 25;
int LEDSpeed = (rand() % 20);
int LEDPower = (rand() % 200)+50;
int B = 0;
int C = rand()%20;
delay(PauseDelay*100);
// Move a single white led
for(int A = (StartLED); A < NUM_LEDS/2; A = A + 1)
{
B = (NUM_LEDS-A);
// Turn our current led on to white, then show the leds
leds[A] = CRGB::White;
leds[B] = CRGB::White;
if (C > 15) {
leds[A] = CRGB::Cyan;
leds[B] = CRGB::Cyan;
}
FastLED.setBrightness(LEDPower);
FastLED.show(); // Show the leds (only one of which is set to white, from above)
// Wait a little bit
delay(LEDSpeed);
// Turn our current led back to black for the next loop around
leds[A] = CRGB::Black;
leds[B] = CRGB::Black;
}
FastLED.clear(); // clear all pixel data
FastLED.show();
}