Now that we have our RGB led on the circuit and correctly working, let's add a push button.
So here you will see that it's going to be very simple.
So you find a push button here on the right, you take the push button and you are going to put it somewhere
here in the middle of the breadboard.
That's what I usually do.
And then, well, we will need to add some connections to that push button.
So first we will need to add a connection to the ground.
And for that I'm going to add also a resistor.
Register here.
Let's so let's directly connect, for example, the leg on the right here to the ground and let's choose
a ten kilo ohm resistor.
So that's going to be brown, black and orange for a four band resistor.
And that's going to be brown, black, black and red for a five band resistor.
So this resistor will act as a pull down resistor.
So basically with this, we can make sure that the purge button state will be low or basically zero
volt by default.
And when we press on the purge button, the state is going to be high or five volt.
Okay.
So that's very important to either use an external resistor or use the internal pull up resistor of
the Arduino, which is going to do the opposite, which means that the state is going to be high by
default and low when you press on the purge button.
All right.
So we have the connection to the ground now.
So if the connection to the ground is on the right side here, the left side is going to be connected
to five volt.
And I'm going to use right here because that's five volt connection.
Okay.
So the push button is now correctly connected to five volt and ground.
And now we are going to add a connection to a digital pin.
So you take the side, okay, which is also connected to the ground.
And from the same line here, you take a wire and let's connect to PIN number seven here.
So I'm going to add double click here.
I'm just going to do this.
To make it nicer.
Okay.
Like this.
And let's choose.
Okay.
Pink, for example.
So from the same side as where you plugged the resistor here, you're gonna put a wire to pin number
seven.
Okay, so we won't use interrupt here.
You can choose any pin you want.
It doesn't really matter.
All right.
And the circuit is done.
And here is the physical circuit with the push button that I've added also alongside with the RGB led.
So here you can see we have the push button on the middle of the breadboard.
And then on the left I have this wire, this red wire to the five volt line here.
And then on the right side, I have this resistor, this ten kilo ohm resistor connected to the ground.
And then a wire from the same line here connected to digital PIN number seven.