how to stop multiple blinking LED/ come fermare piu blinking led

Ciao a tutti!

a primo impatto la mia domanda potrà sembrare banale e ripetitiva ma leggete la mia descrizione qui sotto.

Ho fatto programma che faccia accendere e spegnere prima uno e dopo il seguente LED per un totale di 5 LED disposti in fila. fin qui tutto moooolto semplice. Poi ho pensato di realizzare questo secondo obiettivo: Ho un pulsante e voglio fare in modo che la luce si fermi nel led corrispondente al momento in cui ho premuto il pulsante. Come faccio a realizzarlo?

se vi puo servire il codice che ho realizzato fin ora è il seguente:

Hello everyone!
at first glance my question may seem trivial and repetitive, but read my description below.

I made a program that blinks multiple LEDs one after the other for a total of 5 LEDs in series. so everything is soooo simple. Then I thought of making this second objective: I have a button and I want to make sure that the light is still in the LED corresponding to the time when I pressed the button. How do I achieve it?

if you want to use the code I have made, here it is:

int led = 13;
int led1 = 12;
int led2 = 11;
int led3 = 10;
int led4 = 9;
int led5 = 8;


void setup()
{
 pinMode(led,OUTPUT);
 pinMode(led1,OUTPUT);
 pinMode(led2,OUTPUT);
 pinMode(led3,OUTPUT);
 pinMode(led4,OUTPUT);
 pinMode(led5,OUTPUT);
   
 }

void loop()
{
 
 digitalWrite(led,HIGH);
 delay(30);
 digitalWrite(led,LOW);
 delay(30);
 {
   digitalWrite(led1,HIGH);
   delay(30);
   digitalWrite(led1,LOW);
   delay(30);}
   {
   digitalWrite(led2,HIGH);
   delay(30);
   digitalWrite(led2,LOW);
   delay(30);}
   {
   digitalWrite(led3,HIGH);
   delay(30);
   digitalWrite(led3,LOW);
   delay(30);}
   {
   digitalWrite(led4,HIGH);
   delay(30);
   digitalWrite(led4,LOW);
   delay(30);}
   {
   digitalWrite(led5,HIGH);
   delay(30);
   digitalWrite(led5,LOW);
   delay(30);}

}

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

The first thing you'll have to do is rewrite your program and get rid of all those delay calls. You can't read a button while you're in a delay.

Learn the blink without delay example.

Then, instead of coding each led separately, make a variable to hold which pin number you're working with at that moment, that way you only need one blinking code. Whenever you turn the led off, you can update that variable to the next pin number so it gets turned on next.

Learn the blink without delay example.

See my http://www.thebox.myzen.co.uk/Tutorial/State_Machine.html Or Robin2's several things at once http://forum.arduino.cc/index.php?topic=223286.0