Last active
February 28, 2020 06:52
-
-
Save sudiptamondal/952cd9e14e65f7290bf3f5acdeaba2b9 to your computer and use it in GitHub Desktop.
fastled_arduino.ino
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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