In this experiment, we will learn how to change RGB led colour with push button.
- Arduino or Genuino Board
- Push Button
- RGB led
- Jumper wires
- Take the Breadboard.
- Connect the RGB led onto the breadboard and the push button onto the breadboard.
- Connect the pin for the red colour to the Digital pin 11 on the Arduino.
- Connect the pin for the green colour to the Digital pin 10 on the Arduino.
- Connect the pin for the blue colour to the Digital pin 9 on the Arduino.
- Now connect the +5V and GND to the horizontal side as +5V to plus sign (+) and GND to the negative sign (-) on the breadboard.
- Fix the push button on the breadboard as shown in the above image for connection of the push button to the breadboard
- Connect the one pin of the push button to digital pin 3 on Arduino and other pin to the GND on the breadboard.
- 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