Skip to content

Instantly share code, notes, and snippets.

@Mr-NVR
Last active December 4, 2017 19: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 Mr-NVR/742fbaceb5c28d7ad73844e10096f175 to your computer and use it in GitHub Desktop.
Save Mr-NVR/742fbaceb5c28d7ad73844e10096f175 to your computer and use it in GitHub Desktop.
#include "FastLED.h"
#define DATA_PIN 16
#define CLK_PIN 17
#define LED_TYPE APA102
#define COLOR_ORDER BGR // RGB, BGR
#define NUM_LEDS 64
#define BRIGHTNESS 30
CRGB leds[NUM_LEDS];
void setup() {
Serial.begin(115200);
FastLED.addLeds<LED_TYPE, DATA_PIN, CLK_PIN, COLOR_ORDER, DATA_RATE_MHZ(1)>(leds, NUM_LEDS);
FastLED.setBrightness(BRIGHTNESS);
fill_solid(leds, NUM_LEDS, CRGB::Blue);
FastLED.show();
}
void loop() {
for(int dot = 0; dot < NUM_LEDS; dot++) {
Serial.print("x"); // Print an "x" so we know it's running...
leds[dot] = CRGB::Blue;
FastLED.show();
// clear this led for the next time around the loop
leds[dot] = CRGB::Black;
delay(30);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment