Tutorial 1:How to wire a LED with Arduino - ashima-24/interactive_systems GitHub Wiki
LED:
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.
LEDs have many advantages over incandescent light sources, including:
- Lower energy consumption
- Longer lifetime
- Improved physical robustness
- Smaller size and faster switching.
LEDs are used in applications as diverse as aviation lighting, automotive headlamps, advertising, general lighting, traffic signals, camera flashes, lighted wallpaper, horticultural grow lights, and medical devices.
Components Required:
- LEDs
- Arduino Uno
- Jumper wires
- Resistance (47 ohm)
- Breadboard (optional)
Circuit Diagram:
Youtube Link : You can also make circuit connection by taking help of this link.
Code:
After making the connection between LED, resistor and Arduino you can upload the below code in Arduino IDE.
// Pin 13 has an LED connected on most Arduino boards.
// initialize it with a variable:
int led = 13;
// the setup routine runs once when you press reset:
void setup()
{
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}
// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(led, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}
Great! you have finished your first tutorial. So Let's move on to next tutorial 2.