Skip to content

Instantly share code, notes, and snippets.

@fredowsley
Last active February 27, 2022 23:55
Show Gist options
  • Save fredowsley/818e0173f322efb878d085177730667e to your computer and use it in GitHub Desktop.
Save fredowsley/818e0173f322efb878d085177730667e to your computer and use it in GitHub Desktop.
#include <FastLED.h>
#define NUM_LEDS 160
#define DATA_PIN 6
CRGB leds[160];
int x;
void setup() {
FastLED.addLeds<WS2812B, 6>(leds, 160);
}
void loop() {
// hook a wire from analog 0 to ground as an antenna, or just analog 0 and touch it
randomSeed(analogRead(0));
//choose a random led
x = random(160);
// choose a random color
leds[x] = CHSV(random8(),255,255);
FastLED.show();
delay(5);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment