How to make RGB LED strip flash colors

Hello everybody! I'm new here and I have searched for a long time trying to figure out how to do this. I may not be looking for the right words, but basically here's what I want to do:

LED Strip - Solid Red the whole strip for 3 seconds, flash to a very very light blue (almost white) for about a half a second, back to red for about a half a second, back to the light blue/white for a half a second, and repeat.

I have figured out how to make each LED a certain color, but I can't figure out how to make it jump to another one.

So heres what I'm asking:

How would I go about making a code for what I want to do?

Thanks in advance and sorry for the noobness :slight_smile:

What sort of LED strip have you got? Are the LEDs individually addressable?

To make it jump from one to the other simply follow the instructions for one colour with a delay and then put the instructions for the second colour followed by a delay.

It is just like the blink LED example only setting the colours you want instead of turning a digigital pin alternately high and low.

Hi! OK so I got it to do exactly what I want, but its doing it on just one pixel. I know why, I can see what the code is saying, but how would I select all 300 at once rather than typing it all in individually?
Here’s the code:

#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h>
#endif
#define PIN            7
#define NUMPIXELS      300


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


void setup() {
 pixels.begin();
}

void loop() {

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

   pixels.setPixelColor(0, pixels.Color(255,0,0));
   pixels.show();
   delay(2500);
    
   pixels.setPixelColor(0, pixels.Color(200,200,255));
   pixels.show();
   delay(100);
   
   pixels.setPixelColor(0, pixels.Color(255,0,0));
   pixels.show();
   delay(175);
   
   pixels.setPixelColor(0, pixels.Color(200,200,255));
   pixels.show();
   delay(100);
   
 }
}

You would use a for loop to change all the LEDs , so that is one line for the for loop and a second to change the colour. The index of your for loop will be used as the LED number.