Saturday 13 August 2016

How to glow a LED using arduino

How to glow a LED using arduino (basic)

List of items needed:

  • Arduino Board 
  • Jumper wires 
  • LEDs
  • Resistance (47Ohm)
  • Breadboard (optional)

Connections and circuit diagram :

Let's do some coding in arduino:

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() 
      // initialize the digital pin as an output.
      pinMode(led, OUTPUT);

// the loop routine runs over and over again forever:

void loop() {

      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);                      // wait for a second

     digitalWrite(ledLOW);    // turn the LED off by making the voltage LOW
     delay(1000);                      // wait for a second

Uploading code in arduino:

Connect arduino to the computer then select port:(ex. COM3) 

And simply Click on the Upload Button as given blow :

Now See your LED it will glowing :)

You can do many experiments with time delay and connecting more LEDs .

If you make something new then post in the comment box that will be appreciable.

For any suggestion and query post in comment box.


No comments:

Post a Comment