top of page
Search

GLOWING LED LIGHTS

Writer: Mein-bhi-Engineer
Mein-bhi-Engineer
Jul 1, 2020
1 min read

Updated: Aug 6, 2022

A light-emitting diode (LED) is a semiconductor light source that emits light when current flows through it. Electrons in the semiconductor recombine with electron holes, releasing energy in the form of photons. The color of the light (corresponding to the energy of the photons) is determined by the energy required for electrons to cross the band gap of the semiconductor.


CIRCUIT DIAGRAM


CODE

int bright = 0;

void setup()
{
  pinMode(9, OUTPUT);
}

void loop()
{
  for (bright = 0; bright <= 255; bright += 5) {
    analogWrite(9, bright);
    delay(50); // Wait for 50 millisecond(s)
  }
  for (bright = 255; bright <= 0; bright += 5) {
    analogWrite(9, bright);
    delay(50); // Wait for 50 millisecond(s)
  }
}






 
 
 

1 Comment


hebrew_lucas
Apr 15, 2025

A great explanation of how LEDs work at the semiconductor level. It's amazing how such tiny components power so much of our everyday lighting! www.supermonitoring.com

Like
bottom of page