user18898: I'm trying to get an effect like (https://vine.co/v/Mwwbi5a1BFK) using a neopixel ring. I can get the neopixels to turn on and off in a circle motion and I can get the neopixels to fade all at once. What I can't get working is combining the two together. Any help would be much appreciated!
EDIT Tried making fade with the circle motion
#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(50, 100, 100,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
const byte extra = 4;  // how many ahead, and behind, to light up

// Pause = delay between transitions
// Rf, Gf, Bf = RGB "Foreground" values
// Rb, Gb, Bb = RGB "Background" values
void ledTrail(int pause, int steps, byte Rf, byte Gf, byte Bf, byte Rb, byte Gb, byte Bb) { 

  int tmpR, tmpG, tmpB;         // Temp values
  // Fade up
  for (int s=1; s<=steps; s++) {
    tmpR = (Rf * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (Gf * s) / steps;
    tmpB = (Bf * s) / steps;



  for (int i=0; i<numPix; i++) {
    myNeoPixels.setPixelColor(i,Rf,Gf,Bf);

    // now go "extra" pixels ahead and behind
    for (int s = 1; s < extra + 1; s++)
      {
      tmpR = (Rf * (extra - s)) / extra;     // Multiply first to avoid truncation errors  
      tmpG = (Gf * (extra - s)) / extra;
      tmpB = (Bf * (extra - s)) / extra;
      myNeoPixels.setPixelColor((i + s) % numPix,tmpR,tmpG,tmpB);
      myNeoPixels.setPixelColor((i + numPix - s) % numPix,tmpR,tmpG,tmpB);
      }

        // Fade down
  for (int s=steps; s>0; s--) {
    tmpR = (Rf * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (Gf * s) / steps;
    tmpB = (Bf * s) / steps;
  }

    myNeoPixels.show();
    delay(pause);
  }
   }
}

LED TRAIN CODE
#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);
  }
}

BREATHING CODE
#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() {
  breathe(20, 100, 255,255,255);       // Pause; Number of steps; Full-on R,G,B values
}


// Pause = delay between transitions
// Steps = number of steps
// R, G, B = Full-on RGB values
void breathe(int pause, int steps, byte R, byte G, byte B) { 

  int tmpR, tmpG, tmpB;         // Temp values

  // Fade up
  for (int s=1; s<=steps; s++) {
    tmpR = (R * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (G * s) / steps;
    tmpB = (B * s) / steps;

    for (int i=0; i<numPix; i++) {
      myNeoPixels.setPixelColor(i,tmpR,tmpG,tmpB);
    }
    myNeoPixels.show();
    delay(pause);
  }    

  // Fade down
  for (int s=steps; s>0; s--) {
    tmpR = (R * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (G * s) / steps;
    tmpB = (B * s) / steps;

    for (int i=0; i<numPix; i++) {
      myNeoPixels.setPixelColor(i,tmpR,tmpG,tmpB);
    }
    myNeoPixels.show();
    delay(pause);
  }    

  delay(pause * 30);
}


user10794: I don't have any NeoPixels to try it with (yet) however this should do it. Replace the ledTrail function by this:
const byte extra = 4;  // how many ahead, and behind, to light up

// 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) { 

  int tmpR, tmpG, tmpB;         // Temp values

  for (int i=0; i<numPix; i++) {
    myNeoPixels.setPixelColor(i,Rf,Gf,Bf);

    // now go "extra" pixels ahead and behind
    for (int s = 1; s < extra + 1; s++)
      {
      tmpR = (Rf * (extra - s)) / extra;     // Multiply first to avoid truncation errors  
      tmpG = (Gf * (extra - s)) / extra;
      tmpB = (Bf * (extra - s)) / extra;
      myNeoPixels.setPixelColor((i + s) % numPix,tmpR,tmpG,tmpB);
      myNeoPixels.setPixelColor((i + numPix - s) % numPix,tmpR,tmpG,tmpB);
      }

    myNeoPixels.show();
    delay(pause);
  }
}

What this is doing is having an inner loop that "looks ahead" and behind another extra pixels and makes them brighter/darker. Debugging code (since removed) shows the effect:
i = 4, R = 255, G = 255, B = 255   <-- original code
i = 5, R = 191, G = 191, B = 191   <-- one ahead  (darker)
i = 3, R = 191, G = 191, B = 191   <-- one behind (darker)
i = 6, R = 127, G = 127, B = 127   <-- two ahead  (darker still)
i = 2, R = 127, G = 127, B = 127   <-- two behind (darker still)
i = 7, R = 63, G = 63, B = 63      <-- and so on
i = 1, R = 63, G = 63, B = 63
i = 8, R = 0, G = 0, B = 0
i = 0, R = 0, G = 0, B = 0


18898: <p>I'm trying to get an effect like (<a href="https://vine.co/v/Mwwbi5a1BFK" rel="nofollow">https://vine.co/v/Mwwbi5a1BFK</a>) using a neopixel ring. I can get the neopixels to turn on and off in a circle motion and I can get the neopixels to fade all at once. What I can't get working is combining the two together. Any help would be much appreciated!</p>

<p><em>EDIT</em> Tried making fade with the circle motion</p>

<pre><code>#include &lt;Adafruit_NeoPixel.h&gt;          // 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(50, 100, 100,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
const byte extra = 4;  // how many ahead, and behind, to light up

// Pause = delay between transitions
// Rf, Gf, Bf = RGB "Foreground" values
// Rb, Gb, Bb = RGB "Background" values
void ledTrail(int pause, int steps, byte Rf, byte Gf, byte Bf, byte Rb, byte Gb, byte Bb) { 

  int tmpR, tmpG, tmpB;         // Temp values
  // Fade up
  for (int s=1; s&lt;=steps; s++) {
    tmpR = (Rf * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (Gf * s) / steps;
    tmpB = (Bf * s) / steps;



  for (int i=0; i&lt;numPix; i++) {
    myNeoPixels.setPixelColor(i,Rf,Gf,Bf);

    // now go "extra" pixels ahead and behind
    for (int s = 1; s &lt; extra + 1; s++)
      {
      tmpR = (Rf * (extra - s)) / extra;     // Multiply first to avoid truncation errors  
      tmpG = (Gf * (extra - s)) / extra;
      tmpB = (Bf * (extra - s)) / extra;
      myNeoPixels.setPixelColor((i + s) % numPix,tmpR,tmpG,tmpB);
      myNeoPixels.setPixelColor((i + numPix - s) % numPix,tmpR,tmpG,tmpB);
      }

        // Fade down
  for (int s=steps; s&gt;0; s--) {
    tmpR = (Rf * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (Gf * s) / steps;
    tmpB = (Bf * s) / steps;
  }

    myNeoPixels.show();
    delay(pause);
  }
   }
}
</code></pre>

<p><em>LED TRAIN CODE</em></p>

<pre class="lang-c prettyprint-override"><code>#include &lt;Adafruit_NeoPixel.h&gt;          // 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&lt;numPix; i++) {
    myNeoPixels.setPixelColor(i,Rf,Gf,Bf);
    myNeoPixels.show();
    delay(pause);
  }

  for (int i=0; i&lt;numPix; i++) {
    myNeoPixels.setPixelColor(i,Rb,Gb,Bb);
    myNeoPixels.show();
    delay(pause);
  }
}
</code></pre>

<p><em>BREATHING CODE</em></p>

<pre class="lang-c prettyprint-override"><code>#include &lt;Adafruit_NeoPixel.h&gt;          // 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() {
  breathe(20, 100, 255,255,255);       // Pause; Number of steps; Full-on R,G,B values
}


// Pause = delay between transitions
// Steps = number of steps
// R, G, B = Full-on RGB values
void breathe(int pause, int steps, byte R, byte G, byte B) { 

  int tmpR, tmpG, tmpB;         // Temp values

  // Fade up
  for (int s=1; s&lt;=steps; s++) {
    tmpR = (R * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (G * s) / steps;
    tmpB = (B * s) / steps;

    for (int i=0; i&lt;numPix; i++) {
      myNeoPixels.setPixelColor(i,tmpR,tmpG,tmpB);
    }
    myNeoPixels.show();
    delay(pause);
  }    

  // Fade down
  for (int s=steps; s&gt;0; s--) {
    tmpR = (R * s) / steps;     // Multiply first to avoid truncation errors  
    tmpG = (G * s) / steps;
    tmpB = (B * s) / steps;

    for (int i=0; i&lt;numPix; i++) {
      myNeoPixels.setPixelColor(i,tmpR,tmpG,tmpB);
    }
    myNeoPixels.show();
    delay(pause);
  }    

  delay(pause * 30);
}
</code></pre>
 10794: <p>I don't have any NeoPixels to try it with (yet) however this should do it. Replace the ledTrail function by this:</p>



<pre class="lang-C++ prettyprint-override"><code>const byte extra = 4;  // how many ahead, and behind, to light up

// 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) { 

  int tmpR, tmpG, tmpB;         // Temp values

  for (int i=0; i&lt;numPix; i++) {
    myNeoPixels.setPixelColor(i,Rf,Gf,Bf);

    // now go "extra" pixels ahead and behind
    for (int s = 1; s &lt; extra + 1; s++)
      {
      tmpR = (Rf * (extra - s)) / extra;     // Multiply first to avoid truncation errors  
      tmpG = (Gf * (extra - s)) / extra;
      tmpB = (Bf * (extra - s)) / extra;
      myNeoPixels.setPixelColor((i + s) % numPix,tmpR,tmpG,tmpB);
      myNeoPixels.setPixelColor((i + numPix - s) % numPix,tmpR,tmpG,tmpB);
      }

    myNeoPixels.show();
    delay(pause);
  }
}
</code></pre>

<p>What this is doing is having an inner loop that "looks ahead" and behind another <code>extra</code> pixels and makes them brighter/darker. Debugging code (since removed) shows the effect:</p>



<pre class="lang-none prettyprint-override"><code>i = 4, R = 255, G = 255, B = 255   &lt;-- original code
i = 5, R = 191, G = 191, B = 191   &lt;-- one ahead  (darker)
i = 3, R = 191, G = 191, B = 191   &lt;-- one behind (darker)
i = 6, R = 127, G = 127, B = 127   &lt;-- two ahead  (darker still)
i = 2, R = 127, G = 127, B = 127   &lt;-- two behind (darker still)
i = 7, R = 63, G = 63, B = 63      &lt;-- and so on
i = 1, R = 63, G = 63, B = 63
i = 8, R = 0, G = 0, B = 0
i = 0, R = 0, G = 0, B = 0
</code></pre>
