#include <FastLED.h>
// How many leds in your strip?
#define NUM_LEDS 128
// For led chips like Neopixels, 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
#define DATA_PIN 7
#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
LEDS.addLeds<WS2812,DATA_PIN,RGB>(leds,NUM_LEDS);
LEDS.setBrightness(80);
}
void loop() {
//generate wave for changing led pixels
uint16_t sinBeat = beatsin16(30, 0, NUM_LEDS, 0, 0);
//generate wave for colors
uint8_t colBeat = beatsin8(45, 0, 255, 0, 0);
//assign colors to pixels
leds[sinBeat] = CHSV(colBeat, 255, 255);
fadeToBlackBy(leds, NUM_LEDS, 10);
FastLED.show();
}