Interfacing of Led With Arduino:

by embeddedbymedhavi in Circuits > Arduino

67 Views, 0 Favorites, 0 Comments

Interfacing of Led With Arduino:

leddd.jpg

Led ( Light emitting diode) : Light Emitting Diodes are the mostly commonly used components in many applications. They are made of semiconducting material. This article describes about basic interfacing of LEDs to the 8051 family microcontrollers.

Circuit Diagram for Blinking a Led:

ledavr4.png

Turns on an LED on for One Second, Then Off for One Second, Repeatedly.

int led1 = 13;

int led2 = 12;

int led3 = 11;

int led4 = 10;// the setup routine runs once when you press reset:

void setup() { // initialize the digital pin as an output.

pinMode(led1, OUTPUT);

pinMode(led2, OUTPUT);

pinMode(led3, OUTPUT);

pinMode(led4, OUTPUT);}// the loop routine runs over and over again forever:

void loop() {

digitalWrite(led1, HIGH);

digitalWrite(led2, LOW);

digitalWrite(led3, HIGH);

digitalWrite(led4, LOW); // turn the LED on (HIGH is the voltage level)

delay(1000); // wait for a second

digitalWrite(led1, LOW);

digitalWrite(led2, HIGH);

digitalWrite(led4, HIGH);

digitalWrite(led3, LOW);// turn the LED off by making the voltage LOW

delay(1000); // wait for a second}

Simulation:

Video of Of LED With Arduino Microcontroller Using Arduino IDE

Interfacing of LED with Arduino Microcontroller using Arduino IDE