Flickering Neopixel strip during Rainbow+Fade issue[Solved]

How's it going everybody, first post here, I'll dive right in...

I'm using:
Uno R3 - from usb
Neopixel strip - 20 pixels - from a 5v 700ma wall source

and I'm trying to get them to fade through the rainbow while pulsing in brightness. I managed to achieve this by cobbling together some found/example code, but now I'm running into an issue with the strip flickering while doing the pulse. Here's my code thus far:

#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(20, PIN, NEO_GRB + NEO_KHZ800);

int fadeControl = 255;//will hold the current brightness level
int fadeDirection = -1;//change sign to fade up or down
int fadeStep = 20;//delay between updates

void setup() {
  strip.begin();
  strip.show();
}

void loop() {
  rainbowpulse(50);
}

void rainbowpulse(uint8_t wait) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
 strip.setBrightness(fadeControl);//set the pixel brightness
  strip.show();
  fadeControl = fadeControl + fadeDirection;//increment the brightness value
  if (fadeControl <0 || fadeControl > 255)
  //If the brightness value has gone past its limits...
  {
    fadeDirection = fadeDirection * -1;//change the direction...
    fadeControl = fadeControl + fadeDirection;//...and start back.
  } 
  delay(fadeStep);//wait a bit before doing it again.
}
  }
}
  
  
  
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}

and here's a link to a video of what's happening(it's like 2 minutes long but you can get the point in the first 30sec or so):

Anyone have any ideas on how I could achieve this without this flicker?

I don't see flickering more choppyness, ie not smooth.

It's not flickering on/off per say?

I'm sorry, perhaps choppy would be a better term to describe it.

I wasn't really sure what to call it, that's why I included the video. So thanks :slight_smile:

Updated question to reflect lingo correction:
How can I smooth it out while keeping the same rate of rainbow change/pulse?

Thanks!

I figured it out!
I was calling strip.show() for every pixel update, instead of every strip update.
by changing that (and then messing with the delay time) I managed to kill the jitter. Now my code looks like this :

#include <Adafruit_NeoPixel.h>

#define PIN 6

Adafruit_NeoPixel strip = Adafruit_NeoPixel(20, PIN, NEO_GRB + NEO_KHZ800);

int fadeControl = 255;//will hold the current brightness level
int fadeDirection = -1;//change sigen to fade up or down

void setup() {
  strip.begin();
  strip.show();
}

void loop() {
  rainbowpulse(150);
}

void rainbowpulse(uint8_t fadeStep) {
  uint16_t i, j;

  for(j=0; j<256; j++) {
    for(i=0; i<20; i++) {
      strip.setPixelColor(i, Wheel((i+j) & 255));
 strip.setBrightness(fadeControl);//set the strip brightness
  
  fadeControl = fadeControl + fadeDirection;//increment the brightness value
  if (fadeControl <20 || fadeControl > 255)
  //If the brightness value has gone past its limits...
  {
    fadeDirection = fadeDirection * -1;//change the direction...
    fadeControl = fadeControl + fadeDirection;//...and start back.
  }
    }
   
  strip.show();
  delay(fadeStep);//wait a bit before doing it again.

  }
}
  
  
  
uint32_t Wheel(byte WheelPos) {
  if(WheelPos < 85) {
   return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
  } else if(WheelPos < 170) {
   WheelPos -= 85;
   return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
  } else {
   WheelPos -= 170;
   return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
  }
}