5 leds chase effect

int potPin=3, i;
void setup() {
for(i=6; i<=10; i++)
pinMode(i, OUTPUT);
}
void loop() {
for(i=6; i<=10; i++){
digitalWrite(i, HIGH);
delay(analogRead(potPin));
digitalWrite(i, LOW);
}
for(i=9; i>=7; i--){
digitalWrite(i, HIGH);
delay(analogRead(potPin));
digitalWrite(i, LOW);
}
}

Hello guys , can someone tell me what does that "i" means in int potPin=3, i;

You are creating a variable i that is an integer.

Same as:

int potPin=3;
int i;

thank you

and do u know why when it finish i = 10 it does i=9 till i=7? why not i=10 till i=6 for the 5 leds chase effect

Do you know what is happening in the code quoted above ?

i think is

pinMode(6,OUTPUT);
pinMode(7,OUTPUT);
pinMode(8,OUTPUT);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);

to make those pin connected leds able to light

Yes


Do you know what this does ?


for(i=6; i<=10; i++){
digitalWrite(i, HIGH);
delay(analogRead(potPin));
digitalWrite(i, LOW);
}

make pin 6 to 10 light one by one

Yes.

A LED on pin 6 goes ON for a delay period then goes OFF.
Then pins 7, 8, 9 and 10.


Explain what happens here ?


for(i=9; i>=7; i--){
digitalWrite(i, HIGH);
delay(analogRead(potPin));
digitalWrite(i, LOW);

theres the problem on me i think is the same as u said but its from 9 to 7

What question do you have ?


int potPin=3;
int i;

void setup() 
{
  for(i=6; i<=10; i++)
  pinMode(i, OUTPUT);
}
void loop()  
{
  for(i=6; i<=10; i++)
{
  digitalWrite(i, HIGH);
  delay(analogRead(potPin));
  digitalWrite(i, LOW);
}

for(i=9; i>=7; i--)
{
  digitalWrite(i, HIGH);
  delay(analogRead(potPin));
  digitalWrite(i, LOW);
}

} //END of loop( )

oh i figured out thanks bro i forgot that its in a loop() thanks