Steps to connect a led with arduino using breadboard :
- Take a led and first check its terminals for positive and negative.
- Among the two terminal ,the one with the short leg is negative terminal and the one with the long leg is positive one.
- Another way to find the terminal of led is to have a close look on the head of each one, the one with flat head is negative and pointed one is positive.
- Now take a breadboard and place the led in one position as shown in the figure and connect the positive terminal of led with pin number 13 of arduino using jumper wires or simple wires that you have.
- At the other terminal connect a resistance of 1 k-ohm and provide ground to it through jumper wires from arduino.
- The default led with arduino will blink according to the code given.
- Now change the delay time given and you can see the difference in its blinking.
Arduino Code for LED Blinking: DOWNLOAD
int led = 13;
void setup()
{
pinMode(led, OUTPUT);
}
void loop()
{
digitalWrite(led, HIGH);
delay(1000);
digitalWrite(led, LOW);
delay(1000);
}
0 Comments