Saturday 30 April 2016

Arduino Uno Tutorial - Blinking LED


Hi,

I never worked on Arduino before so it's really interesting!..

Just to give you basic intro, we can use Arduino board for connecting multiple sensors, LED's, Display Units and program them to what we want!.

To start with, lets blink an LED !



  1. Take any sample LED light, in simple language it always has 2 "Legs" one is long and other is short -  Long Leg = Positive (+)   ,  Short Leg = Negative  (-)
  2. For this project, insert Short Leg of your LED into ground socket "GND" of your Arduino board and Long Leg into Socket No. 13
  3. Now your all set for programming your Arduino Board.
  4. You need Arduino IDE for writing a program, and its similar to C programming!
  5. Download your IDE from https://www.arduino.cc/en/Main/Software
  6. Setup() function is used for setting up environment, like declaring variables 
  7. loop() function is used for executing code continuously
void setup() {
  // initialize digital pin 13 as an output.
  pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(13, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(100);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(100);              // wait for a second
}


That's it, now its time to run your first program on Arduino UNO.


Blue LED - Short Leg connected to GND and Long Leg connected to pin 13 of Arduino





















Arduino IDE - Program to Blink LED connected on pin 13

















LED Started Blinking!....


























Will post more on Arduino Board soon...

No comments:

Post a Comment