RGB LEDs with one button

Hello,
I have RGB LEDs on my wall and I have a lot of program (flashRGB, flash raimbow, up and down, up and down raimbow...).
I want to put every program in one single and when I push the button it's must pass to the next one. But it doesn't work !

Each proram = 5 to 30 secondes
I have one button (on INPUT_PULLUP)

Please help me

Please go read the forum rules. I think you broke a couple already (rule 11).

I did this, but it stays red

const int sortieR = 3;
const int sortieV = 4;
const int sortieB = 5;
const int bouton = 10;
int tps = 2 ;
int lumin = 255 ;
void setup() {
  // put your setup code here, to run once:
pinMode(sortieR, OUTPUT);
pinMode(sortieV, OUTPUT);
pinMode(sortieB, OUTPUT);

}

void loop() {
  // put your main code here, to run repeatedly:

while(1==1)
{
analogWrite(sortieR, 255);
analogWrite(sortieV, 0);
analogWrite(sortieB, 0);
  if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 255);
analogWrite(sortieV, 0);
analogWrite(sortieB, 0);
 if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 255);
analogWrite(sortieV, 0);
analogWrite(sortieB, 0);
 if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
}

I work on a Arduino Mega2560
3 transistors irfz44n chanel n

I did this, but it stays red

Yes, that is what you code does. Every time you press the button it will change from red to... Red!

I have a lot of program (flashRGB, flash raimbow, up and down, up and down raimbow...).

Why don't you try that code? It sounds more interesting than your red changing to red code.

Sorry, maybe it's better but I can't test now :

void loop() {

while(1==1)
{
analogWrite(sortieR, 255);
analogWrite(sortieV, 0);
analogWrite(sortieB, 0);
  if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 0);
analogWrite(sortieV, 255);
analogWrite(sortieB, 0);
 if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 0);
analogWrite(sortieV, 0);
analogWrite(sortieB, 255);
 if (digitalRead(bouton)==HIGH)
  {
   break;
  }
}
}

Yes, but to pass to the next one I need to download it in arduino. And I want when I push the button he pass to the next one.
(I can't test program now I am not in my student room)

That looks better, at least you should see something happen now when you press the button. But it will still not do what you want. Try to figure out why.

const int sortieR = 3;
const int sortieV = 4;
const int sortieB = 5;
const int bouton = 10;
int tps = 2 ;
int lumin = 255 ;
void setup() {
  // put your setup code here, to run once:
pinMode(sortieR, OUTPUT);
pinMode(sortieV, OUTPUT);
pinMode(sortieB, OUTPUT);
pinMode(10,INPUT_PULLUP);

}

void loop() {

while(1==1)
{
analogWrite(sortieR, 255);
analogWrite(sortieV, 0);
analogWrite(sortieB, 0);
  if (digitalRead(bouton)==LOW)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 0);
analogWrite(sortieV, 255);
analogWrite(sortieB, 0);
 if (digitalRead(bouton)==LOW)
  {
   break;
  }
}
while(1==1)
{
analogWrite(sortieR, 0);
analogWrite(sortieV, 0);
analogWrite(sortieB, 255);
 if (digitalRead(bouton)==LOW)
  {
   break;
  }
}
}

Ok, now, when I press the button it's white (go in loop and break very fast). When I take of my finger it's one of the 3 color randomly.
,
I know, it's the break does many times. I should put a mémory, but how ?

Your sketch needs to wait for the button to be released before it waits for another press.