diff --git a/hoverserial.ino b/hoverserial.ino index 5699c54..e4b62dd 100644 --- a/hoverserial.ino +++ b/hoverserial.ino @@ -4,10 +4,11 @@ #include #include -#define PIN PB_5 // Pin where NeoPixels are connected +#define PIN PB5 // Pin where NeoPixels are connected +#define NB_LED 12 // number of LEDs // Declare our NeoPixel strip object: -Adafruit_NeoPixel strip(32, PIN, NEO_GRB + NEO_KHZ800); +Adafruit_NeoPixel strip(NB_LED, PIN, NEO_GRB + NEO_KHZ800); // Argument 1 = Number of pixels in NeoPixel strip // Argument 2 = Arduino pin number (most are valid) // Argument 3 = Pixel type flags, add together as needed: @@ -70,6 +71,19 @@ SerialFeedback NewFeedback; int cmd1; // normalized input values. -1000 to 1000 int cmd2; +// ########################## colorWipe ########################## +// Fill strip pixels one after another with a color. Strip is NOT cleared +// first; anything there will be covered pixel by pixel. Pass in color +// (as a single 'packed' 32-bit value, which you can get by calling +// strip.Color(red, green, blue) as shown in the loop() function above), +// and a delay time (in milliseconds) between pixels. +void colorWipe(uint32_t color, int wait) { + for(int i=0; i