int ledPins[] = {2, 4, 5, 25, 33};
int led = 0;
#define LED 2
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
Serial.println("Hello, ESP32!");
for(int i = 0; i < 5;i++)
{
pinMode(ledPins[i], OUTPUT);
}
}
void loop() {
// put your main code here, to run repeatedly:
for(int i = 0;i < 5; i++)
{
digitalWrite(ledPins[i], HIGH);
Serial.print("prende led "); Serial.println(ledPins[i]);
delay(500); // this speeds up the simulation
digitalWrite(ledPins[i], LOW);
Serial.print("apaga led "); Serial.println(ledPins[i]);
delay(500); // this speeds up the simulation
}
for(int i = 3;i > 0; i--)
{
digitalWrite(ledPins[i], HIGH);
Serial.print("prende led "); Serial.println(ledPins[i]);
delay(500); // this speeds up the simulation
digitalWrite(ledPins[i], LOW);
Serial.print("apaga led "); Serial.println(ledPins[i]);
delay(500); // this speeds up the simulation
}
}