Adjustable Blinking Led

by iamrealCruz in Circuits > Arduino

7 Views, 0 Favorites, 0 Comments

Adjustable Blinking Led

IMG_2622.JPG

I made an Arduino circuit in my Mech 1 class. The Arduino is connected to the breadboard and a potentiometer. the potentiometer can change how fast the led will "blink."

Supplies

1x Arduino Uno

1x Laptop with Arduino IDE

1x USB A to USB B cable

6x Wires

1x POTENTIOMETER

1x LED

1x 330 ohm resistor

Wiring Arduino

Screenshot 2024-09-04 111554.png

get all your supplies, then use three wires connect the potentiometer output to A0 on the arduino board. Connect another wire from the voltage pinout to negative rail on the breadboard. Connect another wire from the ground pinout to positive rail on the breadboard.

On the arduino board, connect 5V on analog in to positive rail on the breadboard and GND to negative rail on breadboard.

Next, connect your resistor from the negative rail to the main circuit area. Then, have an LED (anode side) connect to the resistor and have the cathode side wire to pinout 13 on the arduino's digital side.

Code

Screenshot 2024-09-04 112319.png

Example code of AnalogInput, making the LED blink faster or slower depending on the potentiometer which is the sensorValue.

Arduino IDE

Use the Arduino IDE and put in the code shown above. You will need to connect your USB A to USB B cable into the Arduino Uno board.