WEBVTT

00:00.210 --> 00:07.440
Now that you have correctly plugged your LCD display screen with your OTTERNESS secret, let's actually

00:07.440 --> 00:14.730
see how to print some text on the LCD screen and you will see that's actually really simple to do.

00:15.180 --> 00:21.840
So we just need to set up the pins and the LCD screen correctly and then that would be super easy.

00:22.170 --> 00:31.980
So the first thing we need to do is to include a new library, include liquid crystal dot h.

00:32.320 --> 00:39.240
OK, so just like we have done with the iPad from memory, if you remember, we use the same format,

00:39.240 --> 00:40.560
OK, for include.

00:40.860 --> 00:43.810
But this time we use, of course, liquid crystal.

00:44.760 --> 00:52.380
This is the library to print text on the LTTE display screen and this library is already installed with

00:52.380 --> 00:53.130
your Arduino.

00:54.360 --> 01:01.680
So now what we need to do, we are going to do define for all the things that we need, OK, for that

01:01.680 --> 01:02.350
library.

01:02.520 --> 01:07.790
So once we have done that, we don't need to worry anymore about the numbers of the pin.

01:08.430 --> 01:11.670
So I'm going to start with LCD and then the name of the PIN.

01:11.680 --> 01:20.990
So Elsley are as being we are going to need that beam and that pin is actually plugged to unlock a five.

01:21.240 --> 01:25.710
So that's an analog we are going to use as a normal digital feed.

01:26.280 --> 01:36.090
Then we have LCD screen, which is on a four, also an analog, and we are going to use as a digital

01:36.090 --> 01:38.570
pin and then define density.

01:38.920 --> 01:52.980
We we're going to need default pin, which is lowered to digital PIN number six and the five, which

01:53.340 --> 01:54.530
is on page seven.

01:55.080 --> 01:55.890
Then we have.

01:57.820 --> 02:07.550
That's six and eight and the last one as the seven pin on PIN number nine.

02:07.840 --> 02:11.980
So we are going to need to use those six pins.

02:12.310 --> 02:17.590
So make sure have correctly plugged the component and also make sure that let's say you have used a

02:17.590 --> 02:21.250
different pin than for my secret, which is totally fine.

02:21.670 --> 02:26.500
But make sure you correctly use the right name for the right pin, OK?

02:26.800 --> 02:34.000
And now to initialize the liquid crystal, first we need to create a liquid crystal object or key from

02:34.000 --> 02:35.350
that library.

02:35.600 --> 02:41.540
So to do that, we are going to do that in the global scope liquid crystal.

02:41.890 --> 02:50.020
So you put liquid crystal the name of the library, and then you put LCD open, close parentheses and

02:50.020 --> 02:52.040
don't forget the semicolon.

02:52.060 --> 02:59.380
And here we are going to need to give the different pins, OK, so that the LCD can initialize the pins

02:59.710 --> 03:01.060
with the correct number.

03:01.330 --> 03:03.190
And the first one is the R.

03:03.190 --> 03:03.670
S.

03:04.570 --> 03:06.840
So you need to provide the arguments in the order.

03:06.850 --> 03:07.750
That's very important.

03:08.440 --> 03:09.390
Then you have to eat.

03:10.450 --> 03:12.100
OK, and then default.

03:14.310 --> 03:17.310
What I'm going to do is go back to a new line, so it's.

03:18.650 --> 03:23.450
Easier to read than we have defined the six.

03:24.800 --> 03:30.830
And so just in the other, I have written the pin here, that's very important, you keep the same order

03:30.830 --> 03:31.090
here.

03:32.150 --> 03:32.460
All right.

03:32.540 --> 03:38.120
And once you have done that, well, you don't need to worry anymore about the pins and the hardware.

03:38.390 --> 03:41.740
You just need to use the functionality to bring some text.

03:42.110 --> 03:46.190
So in the setup, we're going to need to initialize the screen.

03:46.220 --> 03:49.550
So that's the same name here.

03:50.030 --> 03:51.310
Don't begin.

03:51.830 --> 03:54.380
And then you need to provide two arguments.

03:54.390 --> 03:56.360
I'm going to be 16 and two.

03:56.660 --> 04:04.340
So basically how many Kolon you are going to use and how many rows of lines you are going to use, because

04:04.370 --> 04:06.910
this is a 16 by two characters screen.

04:06.920 --> 04:13.790
Well, we just put 16 and two because the LCD library will also look for screens that have a different

04:13.790 --> 04:14.210
size.

04:14.210 --> 04:19.960
So with this special hardware, you are going to use LCD beginning with 16 and two.

04:20.390 --> 04:29.820
And once you have done that, you can simply print some text with density that print say hello world.

04:31.100 --> 04:34.780
OK, that's very similar as what you did with the cell communication.

04:34.790 --> 04:40.950
Actually, you just have a print function and then you put some text and let's run this.

04:41.510 --> 04:44.510
So I have connected my board and it's uploading.

04:44.570 --> 04:46.730
It's the same as LCD.

04:49.610 --> 04:52.950
OK, and that is what you may see.

04:52.970 --> 05:00.440
OK, so you will have the energy, so basically the energy of the LCD spoiled answer, the LCD powelltown,

05:00.470 --> 05:02.480
that you don't see any text.

05:02.690 --> 05:08.220
And this is because you actually need to tune the LCD with the potential monitor here.

05:08.540 --> 05:16.640
So the potential matter has the data goes through a pin of the LCD, OK, to tune the contrast of the

05:16.640 --> 05:17.540
LCD screen.

05:17.840 --> 05:24.680
So here, I'm going to turn it and see what I can do and turn it on one side and the other side and

05:24.830 --> 05:28.860
oh, you can see here I get the other one.

05:29.120 --> 05:36.350
So you need the potential to be able to tune the LCD contrast so you can see what's written.

05:36.500 --> 05:39.140
OK, so here it looks good.

05:39.830 --> 05:43.580
And we have the HelloWallet printed on our display screen.

05:44.960 --> 05:51.040
And back to Tinker Cat to show you how it works, so we have our secret with the LCD display screen

05:51.050 --> 05:53.020
actually here, I didn't really mean.

05:53.040 --> 05:58.880
So I'm going to rename it LCD if I see 16 by two.

06:00.510 --> 06:04.990
And so I have the same exact thing, code trying to bring to the world.

06:05.280 --> 06:10.440
Let's run the simulation and let's see what we get on the inside.

06:10.960 --> 06:13.020
So you see, we have to help the world.

06:13.650 --> 06:17.640
And I'm going to this is the position without having to turn it, OK?

06:17.690 --> 06:24.980
And we have the exact same behavior as we had for the real acidy.

06:24.990 --> 06:29.260
So they look here, we were already having HelloWallet.

06:29.910 --> 06:37.590
These OK, this seems the correct said OK, you can see is the same thing for tuning the potential matter

06:38.070 --> 06:41.190
in the real housesitter up in the simulation.
