Skip to content

Instantly share code, notes, and snippets.

@RickDB
Last active September 11, 2015 15:52
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 RickDB/ca59ff69ee857a5f5973 to your computer and use it in GitHub Desktop.
Save RickDB/ca59ff69ee857a5f5973 to your computer and use it in GitHub Desktop.
#include "FastLED.h"
// How many leds in your strip?
#define NUM_LEDS 122
// Data pin that led data will be written out over
#define DATA_PIN 2
// Clock pin only needed for SPI based chipsets when not using hardware SPI
#define CLOCK_PIN 3
#define COLOR_ORDER RGB
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, COLOR_ORDER>(leds, NUM_LEDS);
}
void loop() {
// Rotate colors (R -> G -> B)
LEDS.showColor(CRGB(255, 0, 0));
delay(500);
LEDS.showColor(CRGB(0, 255, 0));
delay(500);
LEDS.showColor(CRGB(0, 0, 255));
delay(500);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment