Advertisement
Guest User

Untitled

a guest
Jun 26th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.85 KB | None | 0 0
  1. #include "FastSPI_LED2.h"
  2.  
  3.  
  4. ////////////////////////////////////////////////////////////////////////////////////////////////////
  5. //
  6. // test code
  7. //
  8. //////////////////////////////////////////////////
  9.  
  10. #define NUM_LEDS 42
  11.  
  12. struct CRGB leds[NUM_LEDS];
  13.  
  14. void setup() {
  15.     // sanity check delay - allows reprogramming if accidently blowing power w/leds
  16.     delay(2000);
  17.  
  18.     // For safety (to prevent too high of a power draw), the test case defaults to
  19.     // setting brightness to 25% brightness
  20.     LEDS.setBrightness(64);
  21.  
  22.     LEDS.addLeds<WS2811, 4>(leds, NUM_LEDS);
  23. }
  24.  
  25. void loop() {
  26.     LEDS.showColor(CRGB(255, 0, 0));  // R
  27.         delay(1000);
  28.     LEDS.showColor(CRGB(0, 0, 255));  // B
  29.         delay(1000);
  30.     LEDS.showColor(CRGB(0, 255, 0));     // G
  31.         delay(1000);
  32.     LEDS.showColor(CRGB(0, 0, 255));  // B
  33.         delay(1000);
  34.       }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement