Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <FastLED.h>
- #define LED_PIN 6
- #define COLOR_ORDER GRB
- #define CHIPSET WS2812B
- #define NUM_LEDS 144
- #define BRIGHTNESS 255
- #define FRAMES_PER_SECOND 24
- CRGB leds[NUM_LEDS];
- void setup() {
- FastLED.addLeds<CHIPSET, LED_PIN, COLOR_ORDER>(leds, NUM_LEDS).setCorrection( TypicalLEDStrip );
- FastLED.setBrightness( BRIGHTNESS );
- }
- void loop() {
- ledsOn();
- FastLED.delay(5000);
- for(int i=NUM_LEDS;i>0;i--){
- leds[i] = CHSV( 0, 0, 0);
- FastLED.show();
- FastLED.delay(1000 / FRAMES_PER_SECOND);
- }
- FastLED.delay(5000);
- }
- void ledsOn() {
- for(int i=0;i<NUM_LEDS;i++){
- int b = map(i, 0, NUM_LEDS, 0, 255);
- leds[i] = CHSV(255,0,b);
- FastLED.show();
- FastLED.delay(1000 / FRAMES_PER_SECOND);
- }
- for(int i=NUM_LEDS;i>0;i--){
- leds[i] = CHSV(255,0,255);
- FastLED.show();
- FastLED.delay(1000 / FRAMES_PER_SECOND);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement