LED – ESP32 board

A light-emitting diode, or LED, is a component capable of emitting light when an electric current passes through it. Today there are LEDS of different colors (red, green, blue, yellow, white) and even LEDS that can display several colors: red, blue and green like RGB LEDS.
The LED only allows current to flow in one direction (from the anode to the cathode). The other direction is called the blocking direction.

Here is the connection of the LED on the ESP32 board:

// Pin GPIO1 where the LED is connected
const int ledPin = 1;

void setup() {
  // Initialize the GPIO1 as an output
  pinMode(ledPin, OUTPUT);
}

void loop() {
  // Turn on the LED
  digitalWrite(ledPin, HIGH);
  // Wait for 1000 milliseconds (1 second)
  delay(1000);
  
  // Turn of the LED
  digitalWrite(ledPin, LOW);
  // Wait for 1000 milliseconds (1 second)
  delay(1000);
}