I'm trying to get an effect like (Vine). The code I have right now can make the leds turn on and off in a circle but it's too abrupt. Any help would be very much appreciated!
#include <Adafruit_NeoPixel.h> // Library for NeoPixels
#define pinPix 6 // Pin driving NeoPixel Ring or String
#define numPix 8 // Number of NeoPixels in the Ring or Strip
// Setup NeoPixel Ring
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number driving the strip
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel myNeoPixels = Adafruit_NeoPixel(numPix, pinPix, NEO_GRB + NEO_KHZ800);
void setup() {
myNeoPixels.begin(); // Initialize the NeoPixel array in the Arduino's memory,
myNeoPixels.show(); // turn all pixels off, and upload to ring or string
}
void loop() {
ledTrail(100, 255,255,255, 0,0,0); // Pause; R,G,B foreground; R,G,B background
}
// Pause = delay between transitions
// Rf, Gf, Bf = RGB "Foreground" values
// Rb, Gb, Bb = RGB "Background" values
void ledTrail(int pause, byte Rf, byte Gf, byte Bf, byte Rb, byte Gb, byte Bb) {
for (int i=0; i<numPix; i++) {
myNeoPixels.setPixelColor(i,Rf,Gf,Bf);
myNeoPixels.show();
delay(pause);
}
for (int i=0; i<numPix; i++) {
myNeoPixels.setPixelColor(i,Rb,Gb,Bb);
myNeoPixels.show();
delay(pause);
}
}