DivinerGregg

Untitled

May 31st, 2016
331
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #define FASTLED_ESP8266_NODEMCU_PIN_ORDER
  2. #include "FastLED.h"
  3.  
  4. #define DATA_PIN 0
  5. #define CLOCK_PIN 2
  6.  
  7. #define NUM_LEDS 40
  8. #define BRIGHTNESS 255
  9. CRGB leds[NUM_LEDS];
  10.  
  11.  
  12. void setup() {
  13. // plug led data into D7 or gpio13
  14.  
  15. FastLED.addLeds<WS2812B, 13>(leds, NUM_LEDS);
  16.  
  17. FastLED.setBrightness( BRIGHTNESS );
  18.  
  19. }
  20.  
  21. void loop() {
  22. // Turn the LED on, then pause
  23. leds[0] = CRGB::Red;
  24. FastLED.show();
  25. delay(500);
  26. // Now turn the LED off, then pause
  27. leds[0] = CRGB::Black;
  28. FastLED.show();
  29. delay(500);
  30. }
Advertisement
Add Comment
Please, Sign In to add comment