WEBVTT

00:00.150 --> 00:05.850
And now that you have a better understanding of digital things as output begins, let's quickly make

00:05.850 --> 00:08.900
a recap of how to work with editor.

00:09.300 --> 00:15.000
So here in our secret, we already have the plugged on PIN number 12.

00:15.510 --> 00:19.950
So the first thing I'm going to do is to do a defined.

00:21.620 --> 00:25.330
Define we've already been 12.

00:25.770 --> 00:33.920
I'm going to create a constant here, we've defined all uppercase with an underscore and then directly

00:33.920 --> 00:34.860
the value.

00:35.150 --> 00:42.560
So whenever we needed to use this number in our code for the NDP, we just need to write a dippin instead,

00:42.860 --> 00:50.740
which will make it much easier later on if, for example, we want to change the being where the entity

00:50.750 --> 00:51.510
is attached.

00:51.710 --> 00:58.820
So first that you use a defined to easily get access to the PIN number in your code and then in the

00:58.820 --> 00:59.090
set.

00:59.180 --> 01:06.650
So I'm going to remove that command in the set that you will use the pin mode function here to set the

01:06.650 --> 01:07.590
mood of the pin.

01:07.760 --> 01:11.150
So by now we have seen only the outputs.

01:11.180 --> 01:16.820
So the first parameter is the PIN number and then the mode.

01:16.820 --> 01:22.580
So the mode will be out, put all the keys and it should be OK.

01:23.090 --> 01:29.630
Once you have done that, the PIN twelve is defined as an output, not an input.

01:29.630 --> 01:38.630
B So from now on, after you have used the pin mode function, you can change the state of the pin and

01:38.630 --> 01:41.780
we can directly do that here if we want to geto.

01:42.140 --> 01:42.650
Right.

01:43.740 --> 01:51.780
Elegy in we've let's say hi, because it will be low by default, but we said the and once we have set

01:51.780 --> 01:57.620
the mode we can directly set the stage, whether high or low, don't know.

01:57.630 --> 02:00.290
Let's say in our program we want to make the energy drink.

02:00.300 --> 02:05.400
But first, when we start the program, we want the energy to be boiled on for three segments.

02:05.430 --> 02:08.880
So, for example, we can do Delate three thousand here.

02:09.690 --> 02:17.070
So we pour on the LCD, we wait for three Siggins and then we we enter the loop function and in the

02:17.070 --> 02:22.770
loop function will digital right in here.

02:22.770 --> 02:30.210
Maybe we are going to start with low and then wait for let's say five hundred milliseconds and then

02:30.210 --> 02:30.930
digital.

02:32.440 --> 02:39.500
Right in high wait for another five hundred milliseconds.

02:40.360 --> 02:45.850
All right, and we have our blink example right here, but nothing complicated, as you can see.

02:45.880 --> 02:52.390
First, we said the mode and once the mode is set, we can just change the state as many times as we

02:52.390 --> 02:52.810
want.

02:53.700 --> 02:56.620
Let's upload this program here.

03:01.450 --> 03:06.850
All right, and you should see Oladipo out on for three singles and now the lady is blinking.
