Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. #define FASTLED_ALLOW_INTERRUPTS 0
  2. #include <FastLED.h>
  3. #define NUM_LEDS 3
  4. #define DATA_PIN D7
  5.  
  6.  
  7. // Define the array of leds
  8. CRGB leds[NUM_LEDS];
  9.  
  10. void setup() {
  11. Serial.begin(115200);
  12. pinMode(D8, OUTPUT);
  13. FastLED.addLeds<WS2812B, DATA_PIN, GRB>(leds, NUM_LEDS);
  14. }
  15.  
  16. void loop() {
  17. // Turn the LED on, then pause
  18. leds[0] = CRGB::Red;
  19. leds[1] = CRGB::Green;
  20. leds[2] = CRGB::Blue;
  21. FastLED.show();
  22. Serial.println("pixel on");
  23. digitalWrite(D8, HIGH);
  24. delay(500);
  25. digitalWrite(D8, LOW);
  26.  
  27. delay(500);
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement