Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
fastled_arduino.ino
#include <FastLED.h>
int led = 13; // Usually the orangle led is set at pin 13.
#define LED_PIN 6 // data pin to be connected to WS2812B
#define NUM_LEDS 60
#define LED_TYPE WS2812B // make sure to choose the correct LED TYPE.
#define COLOR_ORDER GRB
#define BRIGHTNESS 200
#define FRAMES_PER_SECOND 60
bool gReverseDirection = true;
CRGB leds[NUM_LEDS];
void setup() {
pinMode(led, OUTPUT);
delay(2000);
FastLED.addLeds<LED_TYPE, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
FastLED.setBrightness( BRIGHTNESS );
}
// the loop routine runs over and over again forever:
void loop() {
delay(1000); // wait for a second
leds[0] = CRGB::Red;
leds[1] = CRGB::Orange;
leds[2] = CRGB::Green;
FastLED.show();
delay(1000);
FastLED.clear();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.