Advertisement
firtel

Untitled

Feb 3rd, 2022
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. #include <FastLED.h>
  2.  
  3. // How many leds in your strip?
  4. #define NUM_LEDS 1
  5.  
  6. // For led chips like WS2812, which have a data line, ground, and power, you just
  7. // need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
  8. // ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
  9. // Clock pin only needed for SPI based chipsets when not using hardware SPI
  10. #define DATA_PIN 27
  11.  
  12. // Define the array of leds
  13. CRGB leds[NUM_LEDS];
  14.  
  15. void setup() {
  16. // Uncomment/edit one of the following lines for your leds arrangement.
  17. // ## Clockless types ##
  18. FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS); // GRB ordering is assumed
  19.  
  20. }
  21.  
  22. void loop() {
  23. // Turn the LED on, then pause
  24. leds[0] = CRGB::Red;
  25. FastLED.show();
  26. delay(500);
  27. // Now turn the LED off, then pause
  28. leds[0] = CRGB::Black;
  29. FastLED.show();
  30. delay(500);
  31. }
  32.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement