How to Control LEDs With Arduino

Introduction: How to Control LEDs With Arduino

So in this tutorial I am going to light some leds with arduino uno board.

Step 1: Things You Need

Arduino uno
USB 2.0 Cable type
Male to male jumper wires
LEDs
Breadboard

Step 2: Led Explanation

a light-emitting diode (a semiconductor diode which glows when a voltage is applied).
The long side of the led is positive or plus(+) whereas the short side is negative or minus(-).

Step 3: Setting Things

This is the setup of the project.
Connect the ground(GND) pin of the arduino board to the minus(-) side of the led.
Then connect the plus(+) side of the led to 0 pin of the arduino board(if 0 pin does not work use pin 2).
Connect the arduino board to your computer with USB 2.0 Cable.
(you don't need a resistor as shown in the photo).

Step 4: The Code

Go to arduino IDE and name your project as led and save it.
Then write the following code.
If you use pin 2 for the (+) side of the led, then just change the number 0 of the code to 2.(pinMode 2 and digitalWrite 2).

Step 5: Final Result

Now the led will light up if you have used the first code.
If you use the second code the light will blink.

Be the First to Share

    Recommendations

    • Organization Contest

      Organization Contest
    • Space Contest

      Space Contest
    • Halloween Contest

      Halloween Contest

    3 Comments

    0
    chanidu1214
    chanidu1214

    Tip 1 year ago

    You can use arduino mega arduino uno or arduino nano.

    0
    Penolopy Bulnick
    Penolopy Bulnick

    1 year ago

    Nice job on that Arduino tutorial :)

    0
    chanidu1214
    chanidu1214

    Reply 1 year ago

    Thanks