Neopixel first pixels random color - SOLVED

My Neopixel is having some problem. Somtime the fist the 12 first pixel change color. I am using 74AHCT125 to convert 3.3V to 5V

#include "application.h"
#include "neopixel/neopixel.h"

SYSTEM_MODE(AUTOMATIC);

// IMPORTANT: Set pixel COUNT, PIN and TYPE
#define PIXEL_PIN D2
#define PIXEL_COUNT 290
#define PIXEL_TYPE WS2812B

Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE);

void setup()
{
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}

void loop()
{
    for(int i = 0; i < strip.numPixels(); i++){
         strip.setPixelColor(i, 255, 255, 255);
    }
    strip.show();
}

Problem found, the ground from the stip and the controller was not connected right.

1 Like