Guest User

Untitled

a guest
Oct 1st, 2014
266
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.64 KB | None | 0 0
  1. #include "FastLED.h"
  2.  
  3. // How many leds in your strip?
  4. #define NUM_LEDS 240
  5.  
  6. // For led chips like Neopixels, 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. #define DATA_PIN 6
  10. #define CLOCK_PIN 13
  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. // FastLED.addLeds<TM1803, DATA_PIN, RGB>(leds, NUM_LEDS);
  18. // FastLED.addLeds<TM1804, DATA_PIN, RGB>(leds, NUM_LEDS);
  19. // FastLED.addLeds<TM1809, DATA_PIN, RGB>(leds, NUM_LEDS);
  20. FastLED.addLeds<WS2811, DATA_PIN, RGB>(leds, NUM_LEDS);
  21. // FastLED.addLeds<WS2812, DATA_PIN, RGB>(leds, NUM_LEDS);
  22. // FastLED.addLeds<WS2812B, DATA_PIN, RGB>(leds, NUM_LEDS);
  23. // FastLED.addLeds<NEOPIXEL, DATA_PIN, RGB>(leds, NUM_LEDS);
  24. // FastLED.addLeds<UCS1903, DATA_PIN, RGB>(leds, NUM_LEDS);
  25.  
  26. // FastLED.addLeds<WS2801, RGB>(leds, NUM_LEDS);
  27. // FastLED.addLeds<SM16716, RGB>(leds, NUM_LEDS);
  28. // FastLED.addLeds<LPD8806, RGB>(leds, NUM_LEDS);
  29.  
  30. // FastLED.addLeds<WS2801, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  31. // FastLED.addLeds<SM16716, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  32. // FastLED.addLeds<LPD8806, DATA_PIN, CLOCK_PIN, RGB>(leds, NUM_LEDS);
  33. }
  34.  
  35. void loop() {
  36. // Turn the LED on, then pause
  37. leds[0] = CRGB::Red;
  38. FastLED.show();
  39. delay(500);
  40. // Now turn the LED off, then pause
  41. leds[0] = CRGB::Black;
  42. FastLED.show();
  43. delay(500);
  44. }
Advertisement
Add Comment
Please, Sign In to add comment