Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Cylon aka Kitt
- *
- * By: Andrew Tuline
- *
- * Date: Jan, 2020
- *
- * Really simple sketch makes use of some cool FastLED functionality.
- *
- */
- #include "FastLED.h"
- #define NUM_LEDS 20
- #define DATA_PIN 12
- CRGB leds[NUM_LEDS];
- void setup() {
- LEDS.addLeds<WS2812,DATA_PIN,GRB>(leds,NUM_LEDS);
- } // setup()
- void loop() {
- int i = beatsin8(15,0,NUM_LEDS-1);
- leds[i] = CHSV(0, 255, 255);
- FastLED.show();
- fadeToBlackBy(leds, NUM_LEDS, 2);
- } // loop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement