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 :
For online simulation click here: https://circuits.io/circuits/2104669-the-unnamed-circuit
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(led, LOW); // 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.
Thanks.
No comments:
Post a Comment