Lampu Merah — ESP32 simulation

An interactive ESP32 circuit simulation you can run free in your browser on Velxio, by ventoauro9.

Components

Sketch code

#define RED_LED 21
#define YELLOW_LED 19
#define GREEN_LED 18

void setup() {
  // Initialize the GPIO pins as outputs
    pinMode(RED_LED, OUTPUT);
      pinMode(YELLOW_LED, OUTPUT);
        pinMode(GREEN_LED, OUTPUT);
        }

        void loop() {
          // Turn on the red LED for 5 seconds
            digitalWrite(RED_LED, HIGH);
              delay(500);
                digitalWrite(RED_LED, LOW);

                  // Turn on the yellow LED for 2 seconds
                    digitalWrite(YELLOW_LED, HIGH);
                      delay(200);
                        digitalWrite(YELLOW_LED, LOW);

                          // Turn on the green LED for 5 seconds
                            digitalWrite(GREEN_LED, HIGH);
                              delay(500);
                                digitalWrite(GREEN_LED, LOW);
                                }

More projects by ventoauro9