WEBVTT

00:00.150 --> 00:06.780
Let's now see how to actually use the digital bin with a bit of information on the arena, and we are

00:06.780 --> 00:11.580
going to use the analog right function that I'm going to explain to you in just a minute.

00:11.820 --> 00:14.890
But first, we need to change something in our seconds.

00:15.270 --> 00:16.200
Why is that?

00:16.450 --> 00:20.160
But we have our land, which is correct, upload to the original.

00:20.370 --> 00:27.860
But if you look at the thing here, we have the energy to pin number 12, OK?

00:28.080 --> 00:34.750
And the PITIABLY wind function is only available here when you see the Tildy.

00:34.820 --> 00:42.100
OK, so for example, being number 11, 10, nine here would do, but not being number 12.

00:42.450 --> 00:49.200
So if you want to be able to use the analog right function for this LCD, OK, to provide a bit everything

00:49.500 --> 00:51.600
you need to change the beat.

00:51.640 --> 00:59.190
So what I'm going to do is simply so I click on the wire here and there is this dot that I'm going to

00:59.190 --> 01:02.400
change here, the pin number either.

01:03.630 --> 01:04.030
All right.

01:04.560 --> 01:06.370
Nothing else to change.

01:06.390 --> 01:13.680
OK, we just changed to digital for the 80s and now the and it is connected to something that has the

01:13.680 --> 01:20.870
P value and function so we can start to write the code and how to change the pin on the real how know.

01:20.900 --> 01:21.990
Well, it's quite simple.

01:22.000 --> 01:25.200
So first, make sure that you are unplugged your doing about.

01:26.340 --> 01:33.420
And then you simply so you don't change anything, you simply unplug here this way, which is on number

01:33.690 --> 01:40.700
12 and you just put it on number 11 right here, and that's it.

01:42.880 --> 01:48.300
And now back to the original 80s, so if you want, you can also do that directly on Jinkx Acad.

01:48.760 --> 01:55.280
So back to the 80s and you can plug the air in about your computer and make sure you have the correct

01:55.280 --> 01:57.360
board and the correct port here.

01:57.880 --> 02:00.870
And let's see how to use this analog function.

02:01.270 --> 02:06.490
So I'm going to remove hear the comments.

02:07.480 --> 02:13.150
And first, as usual, I'm going to use a defined OK for the energy.

02:14.590 --> 02:16.560
So this time it's not too old.

02:16.810 --> 02:18.740
This time it's either.

02:19.390 --> 02:23.140
Now in the setup function, what I need to do is spin mode.

02:24.040 --> 02:25.660
And in.

02:26.730 --> 02:34.350
Output is slow to initialize the pin, OK, to set the node for the pin, as you could see in the diagram

02:34.680 --> 02:35.770
in the previous lesson.

02:36.240 --> 02:39.950
We still need to set the pin to output mode.

02:39.970 --> 02:44.280
OK, whether you use digital right are another great.

02:44.280 --> 02:47.320
You still need to set the mode as output.

02:48.120 --> 02:52.020
So now the pin has been initialized in the setup function.

02:52.500 --> 02:54.750
Lets directly use the analog.

02:55.860 --> 02:56.780
So analog.

02:57.120 --> 03:00.060
Right, OK, you can see it arranged like this.

03:00.720 --> 03:08.310
So analog and then uppercase w I open the parentheses if I need to provide first.

03:09.340 --> 03:17.140
The PIN number ended in just like we did in digital, right, and then in digital, right, we directly

03:17.140 --> 03:24.100
set high or low states, but we are not afraid we are going to provide a number or an integer number

03:24.370 --> 03:27.720
between zero and 255.

03:28.030 --> 03:29.260
So let's test.

03:30.140 --> 03:31.410
Let's say 20.

03:33.110 --> 03:36.360
So I took the brunt of this and don't forget that semicolon.

03:36.380 --> 03:43.640
So here the program, we simply initialize the entity and set an analog value so applicable to him with

03:43.640 --> 03:44.660
a duty cycle.

03:44.690 --> 03:51.080
OK, which is twenty out of two hundred and fifty five, which is a little bit less than 10 percent.

03:52.070 --> 03:55.600
OK, and let's actually compile and upload the code.

03:55.610 --> 03:57.760
I'm going to name it analog.

03:58.250 --> 03:58.820
Right.

04:03.050 --> 04:10.040
And as you can see, the energy is poured on, but the intensity is quite low.

04:10.160 --> 04:20.900
OK, now let's test with 200, which corresponds to about 78 percent of the power between the intensity

04:20.900 --> 04:23.330
here should be much stronger.

04:23.970 --> 04:24.890
Let's try that.

04:26.420 --> 04:33.770
All right, and as you can see, your editing now is pulled out again, but with higher intensity.

04:35.310 --> 04:42.960
So you can try all kinds of value, OK, between zero and two hundred fifty five to see how the brightness

04:42.960 --> 04:44.620
changes with different values.

04:45.030 --> 04:52.600
And now let's let's try to two special values, which are zero zero zero persons.

04:52.610 --> 04:53.160
So if you.

04:54.320 --> 05:04.030
Tend not to operate with zero, the energy will simply be pulled of and we've 255, the energy will

05:04.130 --> 05:11.060
be powered on with the five volt OK, which is just what you would do with digital.

05:11.060 --> 05:13.340
Right, and high state.

05:14.120 --> 05:14.510
All right.

05:14.510 --> 05:17.860
So as you can see, another right function is not that complicated.

05:18.080 --> 05:22.610
Make sure that the thing you try to use with energy, right.

05:22.760 --> 05:26.600
Has a p value and function, otherwise it won't work.
