Friday 16 October 2015

Led blinking with Arduino Uno

Let's start with led blinking in arduino

Led Blinking Code
Schematics using Fritzing
You can download the source code from the following link:

https://drive.google.com/file/d/0B4Px6Drl6Zz_Z3ZfaGhIallGUnc/view?usp=sharing

The code is self explanatory. Pin number 13 of arduino is configured as output. cost int led=13
makes it a read only variable and also pin number 13 is named as led.
You can use any digital pins i.e from 0 to 13. We have taken pin number 13 because the in-built led of arduino is connected to pin number 13. If you are going to use any other pin please don't forget to connect the external resistor having a minimum value of 220 ohm resistance.

delay(1000)   // It provides a delay of 1000 ms i.e. 1s

Now coming to the calculation of resistance, it is as per according to Ohm's law:

V==IR

The led have forward current of  about 25 milli Amps and voltaage provided by arduino is +5 volts
I = V/R  ....... I  = 5000/25, which comes out to 200 ohms. But this is not a standard value and the nearby value is 220E. Feel free to comment here.


No comments:

Post a Comment