Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@marmilicious
Created December 13, 2016 05:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marmilicious/b6bb31f5dad644b1c1a9f6ef4c61df4e to your computer and use it in GitHub Desktop.
Save marmilicious/b6bb31f5dad644b1c1a9f6ef4c61df4e to your computer and use it in GitHub Desktop.
//------------------------------------------------------------------
#include "FastLED.h"
#define LED_TYPE LPD8806
#define DATA_PIN 11
#define CLOCK_PIN 13
#define NUM_LEDS 32
CRGB leds[NUM_LEDS];
uint8_t time;
//------------------------------------------------------------------
void setup(){
Serial.begin(115200); // Allows serial monitor output (check baud rate)
delay(2500); // Power-up delay
FastLED.addLeds<LED_TYPE, DATA_PIN, CLOCK_PIN, GRB>(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(50);
}
//------------------------------------------------------------------
void loop() {
EVERY_N_MILLISECONDS(40){
time++;
for (int i = 0; i < NUM_LEDS; i++) {
leds[(i + time) % NUM_LEDS] = CHSV( 42, 255, sin8((65535 / NUM_LEDS) * i * 3) );
}
LEDS.show();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment