Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define FASTLED_ESP8266_NODEMCU_PIN_ORDER
- #include "FastLED.h"
- #define DATA_PIN 0
- #define CLOCK_PIN 2
- #define NUM_LEDS 40
- #define BRIGHTNESS 255
- CRGB leds[NUM_LEDS];
- void setup() {
- // plug led data into D7 or gpio13
- FastLED.addLeds<WS2812B, 13>(leds, NUM_LEDS);
- FastLED.setBrightness( BRIGHTNESS );
- }
- void loop() {
- // Turn the LED on, then pause
- leds[0] = CRGB::Red;
- FastLED.show();
- delay(500);
- // Now turn the LED off, then pause
- leds[0] = CRGB::Black;
- FastLED.show();
- delay(500);
- }
Advertisement
Add Comment
Please, Sign In to add comment