A light-emitting diode (LED) is a component that produces light when an electrical current passes through it. Nowadays, there is a wide range of LEDs available in various colors (red, green, blue, yellow, white), as well as multicolored models, such as RGB LEDs, which can display a variety of hues by combining red, green, and blue.

The LED only allows current to flow in one direction, from the anode (positive) to the cathode (negative). In the opposite direction, where current is blocked, it is called the reverse blocking direction.

For this electronic circuit, you will need a 220-ohm resistor, an LED, and a breadboard.

// Define the pin number where the LED is connected
const int ledPin = 10;  // Pin D10 for the LED

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

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