Sunday, 28 February 2016

Blinking LED with Arduino Nano

Hello friends,
Seeing a blinking LED is so much fun, but when you make one like that by yourself then the fun is even more. ^_^

So, let the fun begin,

In this tutorial, i have shown about how to blink an LED with Arduino Nano.

Note : Using an LED without resistor will blow led.
Things you will need.
  1. Arduino Nano
  2. A breadboard
  3. A LED ( I used 3V at 20mA led)
  4. A resistor 100 ohm

Step 1: Wiring.

 

You have to attach LED to the Nano just done in above image.
connect LED's positive end to the one end of resistor and other end to Nano's digital pin 13 & negative end to Nano's ground.
to power Nano board, you can use USB cable or you can also connect a external power supply by connecting positive pin to VIN and and negative to the ground.

Step 2 : Coding

// the setup function runs once when you press reset or power the board
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(1000);              // wait for a second
  digitalWrite(13, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
} 
 
 
 
Coding for blinking LED is so simple.
  • Just connect Nano to PC.
  • Open Arduino IDE software.
  • Go to File > Examples > Basics > Blink.
  • And upload it to the Nano board.
  • In no time, the LED should be Blink. 
  • 1 second On, 1 second OFF.
If you have any question you can ask me in comment section below. ^_^

No comments:

Post a Comment