In this experiment, we will learn how to use button and control LEDs.
- 1 x Arduino Uno ( You can use other boards also )
- 6 x Jumper Wires M-M
- 4 x LED
- 4 x Resistor 330 Ohm
- 1 x Breadboard
- 1 x Tactile Push Button
By this experiment, we will learn to use push button and control the LEDs. This is a circuit which introduces the concept of input/output programming. The output is 4 LED’s and the input being a push button.
- Take Breadboard.
- Take 4 LED it will have one big leg (+) which is a positive and small leg which is Negative.
- Press that two legs and remember which one is a big one ( You can even bend big leg so it’s easy to identify for further reference.
- Now take M-M jumper wires
- Fix the small leg of led(-) to the negative sign on the breadboard and big led to the vertical connection on the breadboard.
- Now take 4 resistors connect them to each big leg of led(+) and then connect them through jumper wire to 6,8,10 and 12 no. of digital pins in the Arduino.
- Now through the jumper wire +5 V to the positive sign(+) in breadboard and GND to the negative sign(-) in the breadboard.
- Now take the push button and connect one leg to the resistor and the connect resistor through then to the Negative sign (-) on the breadboard.
- Take other leg of a push button and connect to the Positive sign of the Breadboard.
- Now take the push button leg to digital pin 4 of Arduino.
- Connect Arduino to your Laptop/PC by USB Cable. ( we use A to B USB cable for Arduino which is also used in printers )
- Open Arduino IDE ( You can download it from here or you can use online platform Arduino Web editor )
- Type the code Below given.
- Check program and then upload it.