WEBVTT

00:00.080 --> 00:06.650
Now that we have our RGB led on the circuit and correctly working, let's add a push button.

00:06.650 --> 00:09.800
So here you will see that it's going to be very simple.

00:09.800 --> 00:17.660
So you find a push button here on the right, you take the push button and you are going to put it somewhere

00:17.660 --> 00:20.570
here in the middle of the breadboard.

00:20.570 --> 00:22.670
That's what I usually do.

00:22.670 --> 00:27.080
And then, well, we will need to add some connections to that push button.

00:27.080 --> 00:30.110
So first we will need to add a connection to the ground.

00:30.110 --> 00:33.680
And for that I'm going to add also a resistor.

00:35.000 --> 00:36.410
Register here.

00:36.440 --> 00:44.090
Let's so let's directly connect, for example, the leg on the right here to the ground and let's choose

00:44.090 --> 00:46.550
a ten kilo ohm resistor.

00:46.550 --> 00:51.740
So that's going to be brown, black and orange for a four band resistor.

00:51.740 --> 00:58.670
And that's going to be brown, black, black and red for a five band resistor.

00:59.000 --> 01:02.660
So this resistor will act as a pull down resistor.

01:02.660 --> 01:08.910
So basically with this, we can make sure that the purge button state will be low or basically zero

01:08.910 --> 01:10.280
volt by default.

01:10.280 --> 01:15.890
And when we press on the purge button, the state is going to be high or five volt.

01:15.920 --> 01:16.160
Okay.

01:16.160 --> 01:22.460
So that's very important to either use an external resistor or use the internal pull up resistor of

01:22.460 --> 01:26.780
the Arduino, which is going to do the opposite, which means that the state is going to be high by

01:26.780 --> 01:29.450
default and low when you press on the purge button.

01:29.750 --> 01:30.110
All right.

01:30.110 --> 01:32.030
So we have the connection to the ground now.

01:32.030 --> 01:38.190
So if the connection to the ground is on the right side here, the left side is going to be connected

01:38.190 --> 01:40.290
to five volt.

01:40.290 --> 01:43.590
And I'm going to use right here because that's five volt connection.

01:43.860 --> 01:44.220
Okay.

01:44.220 --> 01:48.480
So the push button is now correctly connected to five volt and ground.

01:48.480 --> 01:52.380
And now we are going to add a connection to a digital pin.

01:52.380 --> 01:56.430
So you take the side, okay, which is also connected to the ground.

01:56.430 --> 02:05.130
And from the same line here, you take a wire and let's connect to PIN number seven here.

02:05.130 --> 02:07.170
So I'm going to add double click here.

02:07.470 --> 02:08.820
I'm just going to do this.

02:10.320 --> 02:11.820
To make it nicer.

02:14.940 --> 02:15.330
Okay.

02:15.330 --> 02:15.930
Like this.

02:15.930 --> 02:17.910
And let's choose.

02:17.940 --> 02:18.320
Okay.

02:18.330 --> 02:19.170
Pink, for example.

02:19.530 --> 02:27.180
So from the same side as where you plugged the resistor here, you're gonna put a wire to pin number

02:27.180 --> 02:27.790
seven.

02:27.810 --> 02:29.730
Okay, so we won't use interrupt here.

02:29.730 --> 02:32.460
You can choose any pin you want.

02:32.490 --> 02:33.720
It doesn't really matter.

02:33.750 --> 02:34.140
All right.

02:34.140 --> 02:35.580
And the circuit is done.

02:36.240 --> 02:44.310
And here is the physical circuit with the push button that I've added also alongside with the RGB led.

02:44.550 --> 02:48.750
So here you can see we have the push button on the middle of the breadboard.

02:48.750 --> 02:54.740
And then on the left I have this wire, this red wire to the five volt line here.

02:54.750 --> 03:01.890
And then on the right side, I have this resistor, this ten kilo ohm resistor connected to the ground.

03:01.890 --> 03:08.010
And then a wire from the same line here connected to digital PIN number seven.
