Arduino Blink LED

Arduino blink led

In this video, i will show you how to control LED using Arduino. I have also explained the basic program to control LED.

Basics:

setup(){
/*
Use it to initialize variables, pin modes, start using libraries, etc. 
The setup function will only run once, after each powerup or reset of the Arduino 
board. 
*/
}

loop(){
/*the loop() function does precisely what its name suggests, and loops consecutively.
put your main code here, to run repeatedly
*/
}
pinMode(pin, [OUTPUT/INPUT/INPUT_PULLUP]);
    Initialize pin for input or output

digitalWrite(pin, [LOW/HIGH]]);
 
    make the pin LOW or HIGH

digitalRead(pin);
    Reads the value from a specified digital pin, either HIGH or LOW.

delay(ms);
    Pauses the program for the amount of time (in miliseconds) specified as parameter

Led Control Program:

int use_pin=13;
void setup(){
    pinMode(use_pin,OUTPUT);
}
void loop(){
    digitalWrite(use_pin,HIGH);
    delay(1000);
    digitalWrite(use_pin,LOW);
    delay(1000);
}
Plz Share Share on FacebookShare on Google+Share on LinkedInTweet about this on TwitterEmail this to someoneShare on RedditShare on TumblrDigg thisBuffer this pagePrint this pagePin on PinterestShare on StumbleUponFlattr the author
Bookmark the permalink.

2 Comments

  1. Anyone trying to use this tutorial should be aware that the last bit of code above – the actual LED Control Program – contains a typo and will not work as written.

    digitalWrite(use_ping,HIGH);
    should read
    digitalWrite(use_pin,HIGH);

    The poster has been notified but will not fix the typo and insists that it will work if you cut and paste it. He got it right in the video, but you can’t cut and paste from a video!

    If you are a beginner, the standard page on the Arduino site is more helpful than this one – http://arduino.cc/en/tutorial/blink

    My feedback 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *