Daves-Windsor

COD LOADING LOGO

Dec 20th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1.  
  2. #include <Adafruit_NeoPixel.h>
  3.  
  4. #define PIN 2
  5.  
  6. // Parameter 1 = number of pixels in strip
  7. // Parameter 2 = pin number (most are valid)
  8. // Parameter 3 = pixel type flags, add together as needed:
  9. // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
  10.  
  11. // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
  12.  
  13. Adafruit_NeoPixel strip = Adafruit_NeoPixel(32, PIN, NEO_GRB + NEO_KHZ800);
  14.  
  15. int sine[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,}; //these are the pixels in order of animation-- 32 pixels in total
  16.  
  17. void setup() {
  18. strip.begin();
  19. strip.setBrightness(100); //adjust brightness here
  20. strip.show(); // Initialize all pixels to 'off'
  21. }
  22.  
  23. void loop() {
  24. for(int i=0; i<36; i++) {
  25. strip.setPixelColor(sine[i], strip.Color(255, 140, 0)); //change RGB color value here
  26. delay(40);
  27. for (int j=0; j<25; j++){
  28. strip.setPixelColor(sine[(j+i+4)%36], strip.Color(0, 0, 0));
  29. }
  30. strip.show();
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment