Guest User

APA 102c test program

a guest
Jan 15th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.17 KB | None | 0 0
  1. // This #include statement was automatically added by the Particle IDE.
  2. #include "FastLED/FastLED.h"
  3.  
  4.  
  5. FASTLED_USING_NAMESPACE;
  6.  
  7. // How many leds in your strip?
  8. #define NUM_LEDS 86
  9.  
  10.  
  11. #define DATA_PIN A5   // FOR BREADBORD STRIP RUNNING WITH APA102C
  12. #define CLOCK_PIN A3  // FOR BREADBORD STRIP RUNNING WITH APA102C
  13.  
  14.  
  15. // Define the array of leds
  16. CRGB leds[NUM_LEDS];
  17.  
  18.  
  19. void setup() {
  20.   FastLED.addLeds<APA102, DATA_PIN, CLOCK_PIN, BGR>(leds, NUM_LEDS);
  21. }
  22.  
  23. void loop() {
  24.     for (int i=0;i<10;i++){
  25.         fill_solid( &(leds[0]), NUM_LEDS, CRGB(i,0,0)); // test brightness control
  26.         leds[i]=CRGB::Magenta;  // show index information n'th led in strip
  27.         leds[i]%=6;
  28.         FastLED.show();
  29.         delay(1000);
  30.     }  
  31.     for (int i=0;i<10;i++){
  32.        fill_solid( &(leds[0]), NUM_LEDS, CRGB(0,i,0));
  33.         leds[i]=CRGB::CornflowerBlue; // we have hardware fight club here
  34.         leds[i]%=6;
  35.         FastLED.show();
  36.         delay(1000);
  37.     }  
  38.     for (int i=0;i<10;i++){
  39.        fill_solid( &(leds[0]), NUM_LEDS, CRGB(0,0,i));
  40.         leds[i]=CRGB::Yellow;
  41.         leds[i]%=6;
  42.         FastLED.show();
  43.         delay(1000);
  44.     }  
  45. }
Advertisement
Add Comment
Please, Sign In to add comment