Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <Adafruit_NeoPixel.h>
- #define Count 90
- #define Pin 6
- Adafruit_NeoPixel strip = Adafruit_NeoPixel(Count,Pin,NEO_GRB + NEO_KHZ800);
- #define Brightness 10 //Set brightness to 1/10th
- #define Full (255/Brightness)
- //Create scrolling red and white candy cane stripes.
- //Try adjusting the width in pixels for various results.
- //Value "sets" should evenly divide into strand length
- void CandyCane (int sets,int width,int wait) {
- int L;
- for(int j=0;j<(sets*width);j++) {
- for(int i=0;i< strip.numPixels();i++) {
- L=strip.numPixels()-i-1;
- if ( ((i+j) % (width*2) )<width)
- strip.setPixelColor(L,Full,0,0);
- else
- strip.setPixelColor(L,Full,Full, Full);
- };
- strip.show();
- delay(wait);
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement