Guest User

Untitled

a guest
Jan 27th, 2015
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. #include <FastLED.h>
  2.  
  3. #define C_PIN 4 // clock pin
  4. #define D_PIN 5 //data pin
  5. #define BRIGHTNESS 200 //brightness
  6. #define LED_T APA102 // LED Type
  7. #define COLOR_ORDER GBR
  8. #define NUM_LEDS 72 // number of LED's in my strip.
  9.  
  10. CRGB leds[NUM_LEDS]; // name the strip
  11.  
  12. void setup() {
  13. delay(1000) ; //power up safety delay
  14. FastLED.addLeds<LED_T,D_PIN,C_PIN, COLOR_ORDER>(leds, NUM_LEDS);
  15. FastLED.setBrightness(BRIGHTNESS);
  16. }
  17.  
  18. //below is a 2D "grid" multidimensional array already Initialized with data.
  19.  
  20. int TestGrid[5][4] = {
  21. (0,255,0),(0,0,255),(0,255,0),(0,255,0),
  22. (0,255,0),(0,0,255),(0,255,0),(0,255,0),
  23. (0,255,0),(255,0,255),(255,0,0),(0,255,0),
  24. (0,255,0),(0,0,255),(255,0,255),(0,255,0),
  25. (0,255,0),(0,255,0),(0,255,0),(0,255,0)
  26. };
  27.  
  28. void loop() {
  29. leds[0] = CRGB(255,255,0);
  30. leds[1] = CRGB(TestGrid[0][1]);
  31. leds[2] = CRGB(TestGrid[1][2]);
  32. leds[3] = CRGB(TestGrid[2][1]);
  33. leds[4] = CRGB(TestGrid[5][2]);
  34. FastLED.show();
  35. }
Advertisement
Add Comment
Please, Sign In to add comment