Ws2812b with mpu6050 issue

Hi guys just wondering if someone can advise on an issue I have when trying to scale up my project with more LED's.

Currently have a great project on the go where I am using an mpu-6050 to alter the colour of 7 pixels when the sensor is in movement.. There is a slight delay but still fairly quick. I have then gone to make the same thing on a larger scale with 50 pixels but when moving the mpu it takes about a minute for the strip to change colour.

I have reduced the strip to 25 pixels and it takes about half the time to change colour.

Is this just the led pin struggling to get the data down the strip? If so how could I get around this issue?

Any help on the would be greatly appreciated as I am still learning.

You are probably calling the show method with every change in led colour. Wait until you have changed all the led colours before calling show.

This is what I was telling you to do

 void colourWipe(uint32_t colour) {
  for(int i=0; i<strip.numPixels(); i++) { // For each pixel in strip...
    strip.setPixelColor(i, colour);        //  Set pixel's color (in RAM)
}
    strip.show();                          //  Update strip to match
}

As I said move the show call outside the for loop. As it stands you are sending all the data every time you change one pixel. So you are sending the data 47 times to change the whole strip. By only sending the data only once it is a lot faster.

Thank you so much it's working perfectly now

You are welcome, but you shouldn't have deleted your reply after my reply #1, it ruins the narrative and is against the rules here.