Arduino led pendulum

Step 2: Putting up the wires

Strip both ends of wires
-insert one end of each wire into sockets numbered
-Gnd(black wire in my case)-this will be the common ground connection
– 13  (green wire in my case)
– 12  (yellow wire in my case)
– ~11  (orange wire in my case)
– ~10  (red wire in my case)
– 9    (brown wire in my case)
– 8    (brown wire in my case)

Arduino led pendulum

Step 3: Hooking up wires to the breadboard

– hook up the wire connected to gnd(black in my case) to the common vertical line on the the sides of the breadboard
– connect other wires to different horizontal lines at at-least 3 lines left in between(just for convenience)

Confused?-see image

Step 4: Hook up the LED

– Put up the shorter end(-ve) of each led to the common ground line on the vertical line
– put up the longer end(+ve) of each led to the respective coloured wire connected horizontal line

Arduino led pendulum circuit

Step 5: Write, compile and run the sketch

open the arduino software
copy and paste the following sketch-

int led1 = 13;
int led2 = 12;
int led3 = 11;
int led4 = 10;
int led5 = 9;
int led6 = 8;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pins as outputs.
pinMode(led1, OUTPUT);
pinMode(led2, OUTPUT);
pinMode(led3, OUTPUT);
pinMode(led4, OUTPUT);
pinMode(led5, OUTPUT);
pinMode(led6, OUTPUT);


[box color=”#985D00β€³ bg=”#FFF8CB” font=”verdana” fontsize=”14 ” radius=”20 ” border=”#985D12β€³ float=”right” head=”Major Components in Project” headbg=”#FFEB70β€³ headcolor=”#985D00β€³]

Getting the parts

parts needed-
– An arduino board(arduino uno preferable for starters)-don’t worry if u have other and a to b cable
get it here(for Indians)-

– A breadboard
– 7 pieces of wires(preferably differently coloured and more than 6 inches in length)- jumper/solid core preferable
– 6 leds (any color)

tools needed-
– wire stripper and cutter/or pliers (you don’t need them if you have a pair of strong jaws like me) πŸ™‚


For more detail: Arduino led pendulum

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top