Flickering NeoPixels

Hello, I have created a neopixel strip with 50 pixels, it’s powered off a 9v 1a power supply that goes into a breadboard power supply. The colour of the pixels will change when a capacitive touch sensor is pressed, but when the circuit is powered the lights will flicker. The flickering gets progressively more intense with each pixel. I have run the Adafruit test code through it and there is no flickering so I believe there is a problem with the written code. could I please get your help?

#include <Adafruit_NeoPixel.h>
#ifdef AVR
#include <avr/power.h>
#endif

#define tp2 2
#define tp3 3
#define tp4 4
#define tp5 5
#define tp6 6
#define tp7 7
//================================================================

int red1 = 150;
int red2 = 150;
int red3 = 150;
int green1 = 150;
int green2 = 150;
int green3 = 150;
int blue1 = 150;
int blue2 = 150;
int blue3 = 150;

int j = 1;
int k = 0;

int a = 0;
int b = 1;

//=========================================================================================================

#define PIN 9
#define NUMPIXELS 50

Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

#define DELAYVAL 500
//=========================================================================================================

void setup() {

pinMode( tp2, INPUT);
pinMode( tp3, INPUT);
pinMode( tp4, INPUT);
pinMode( tp5, INPUT);
pinMode( tp6, INPUT);
pinMode( tp7, INPUT);

#if defined(AVR_ATtiny85) && (F_CPU == 16000000)
clock_prescale_set(clock_div_1);
#endif
//=========================================================================================================

pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED)
}

void loop() {
pixels.clear(); // Set all pixel colors to ‘off’

a = a + b;

if (a < -50){
b = 1;
}

if (a > 50){
b = -1;
}

int touchValue2 = digitalRead(tp2); //blue, green, turquoise
if (touchValue2 == HIGH){
pixels.clear();
red1 = 0;
green1 = 150 + a;
blue1 = 100 + a/2;
red2 = 0;
green2 = 150 + a;
blue2 = 150 + a;
red3 = 0;
green3 = 150 + a/2;
blue3 = 200 + a;
}

int touchValue3 = digitalRead(tp3); //Green, yellow, orange
if (touchValue3 == HIGH){
pixels.clear();
red1 = 0;
green1 = 150 + a;
blue1 = 0;
red2 = 120 + a/2;
green2 = 150 + a;
blue2 = 0;
red3 = 150 + a;
green3 = 80 + a/2;
blue3 = 0;
}

int touchValue4 = digitalRead(tp4); // red, orange, yellow
if (touchValue4 == HIGH){
pixels.clear();
red1 = 150 + a;
green1 = 35 + a/2;
blue1 = 0;
red2 = 150 + a;
green2 = 80 + a/2;
blue2 = 0;
red3 = 150 + a;
green3 = 0;
blue3 = 0;
}

int touchValue5 = digitalRead(tp5); // Blue, pink, purple
if (touchValue5 == HIGH){
pixels.clear();
red1 = 35 + a/4;
green1 = 0;
blue1 = 150 + a;
red2 = 135 + a;
green2 = 0;
blue2 = 150 + a;
red3 = 15;
green3 = 15;
blue3 = 150 + a;
}

int touchValue6 = digitalRead(tp6); // white
if (touchValue6 == HIGH){
pixels.clear();
red1 = 125 + a2.5;
green1 = 125 - a;
blue1 = 125 - a;
red2 = 125 - a;
green2 = 125 + a
2.5;
blue2 = 125 - a;
red3 = 125 - a;
green3 = 125 - a;
blue3 = 125 + a*2.5;
}

int touchValue7 = digitalRead(tp7); //
if (touchValue7 == HIGH){
pixels.clear();
red1 = 150 + a2;
green1 = 150 + a
2;
blue1 = 150 + a2;
red2 = 150 + a
2;
green2 = 150 + a2;
blue2 = 150 + a
2;
red3 = 150 + a2;
green3 = 150 + a
2;
blue3 = 150 + a*2;
}

for(int i=0; i<NUMPIXELS/3; i++) {

// pixels.Color() takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(3i+2, pixels.Color((red1)/8, (green1)/8, (blue1)/8));
pixels.setPixelColor(3
i+1, pixels.Color((red2)/8, (green2)/8, (blue2)/8));
pixels.setPixelColor(3*i, pixels.Color((red3)/8, (green3)/8, (blue3)/8));

pixels.show();
}

}

50 leds at 60 mA worse case (full white) equals 3A.

Those little breadboard power supplies are not designed for that.

Have you checked how hot the regulator on the breadboard supply gets? I'm not sure if your code will get the leds to full white (cell phones are quite crap for me to read longer code) but just try full white and observe the behaviour of the leds and check the temperature of the breadboard supply.