// declare an array (list) of pins
// int arrayname[size] = {value1, value2, value3};
int PINS[3] = {11, 12, 13};
void setup() {
// set the pinMode() using a loop
for(int i=0 ; i<3 ; i=i+1) {
pinMode(PINS[i] , OUTPUT);
}
}
void loop() {
// loop from the lowest pin to highest
for(int i=0 ; i<3 ; i=i+1) {
// turn on the current pin
digitalWrite(PINS[i] , HIGH);
// delay for 0.3 seconds
delay(300);
// turn off the current pin
digitalWrite(PINS[i] , LOW);
// delay for 0.3 seconds
delay(300);
}
}