Monday, February 18, 2013

ARDUINO PROJECT 1- BLINKING LED



Hi…friends ,……welcome to ARDUINO section of my blog. In this section I am going to discuss various ARDUINO projects. ARDUINO has proved itself as a amazing platform for electronics lovers. So without wasting any time we are moving towards our first projects, obviously a “Hello world” project, in which we will blink an LED.

I am assuming you are having an ARDUINO and required software installed.( in case you are a new bee , don’t worry just let me know I will help you..:))

REQUIREMENTS

Your ARDUINO board
1 LED


CIRCUIT DIAGRAM

Circuit connections are very easy and you have to just connect led at digital pin 13 of ARDUINO as shown , connects anode of LED to digital pin 13 and cathode to ground.( ARDUINO already has 1K resistor to added to pin 13, what allows the immediate connection of a LED between that pin and ground)

LED Blinking Project Schematic


CODE

Here is the source code more commonly known as SKETCH of the project. Just upload this code to your ARDUINO and enjoy your first ARDUINO project.

/* Blinking LED
* ------------
*
* turns on and off a light emitting diode(LED) connected to a digital
* pin, in intervals of 2 seconds. Ideally we use pin 13 on the Arduino
* board because it has a resistor attached to it, needing only an LED
*/
int ledPin = 13; // LED connected to digital pin 13
void setup()
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop()
{
digitalWrite(ledPin, HIGH); // sets the LED on
delay(1000); // waits for a second
digitalWrite(ledPin, LOW); // sets the LED off
delay(1000); // waits for a second
}


So it was just a start in our upcoming articles we will post more interesting and complex ARDUINO projects so stay tuned.

In case of any query, doubt or critical view just leave a comment.

THNX….:)

No comments:

Post a Comment