WEBVTT

00:00.210 --> 00:06.850
Now that you can print some text with the LCD, let's actually play a little bit more with the functionalities

00:06.870 --> 00:11.030
of this LCD screen and actually use the cursor.

00:11.040 --> 00:17.460
So I will show you how to print text to print numbers in different places of the LCD because you have

00:17.520 --> 00:26.880
16 by two, OK, which means that you can print text our character anywhere in these 16 by two matrix

00:26.880 --> 00:28.650
here on the LCD screen.

00:28.860 --> 00:35.580
So first, let's try to understand what happens when you do actually print why this is printed on the

00:35.580 --> 00:36.640
top left.

00:37.170 --> 00:47.400
OK, there is a function actually that you can call is L.C that sets Chiuso should arrange and you can

00:47.400 --> 00:52.050
set the course also the sort of where it's going to print the text.

00:52.500 --> 00:56.210
And the first parameter is the number of the column.

00:56.240 --> 00:59.130
So you can go from zero to 15.

00:59.640 --> 01:06.700
OK, so you have 16 seconds from zero to 15, let's say zero, and then the number of the line.

01:06.730 --> 01:09.660
So line zero, line one.

01:09.810 --> 01:13.830
OK, there are two lines, so let's put zero and zero.

01:14.730 --> 01:21.750
So when you set the cursor to zero and zero, that is the default behavior and that's what you are going

01:21.750 --> 01:23.520
to get with this.

01:23.550 --> 01:29.370
OK, so when you don't put this line, it's just like you have said the cursor to zero and zero.

01:29.770 --> 01:32.130
OK, now let's change this.

01:32.250 --> 01:32.970
Let's change.

01:33.300 --> 01:35.690
Let's put three here.

01:36.690 --> 01:45.860
So we are going to start to set the Khutsong and the three, so the fourth column and the first line,

01:46.200 --> 01:48.900
let's see, we don't applaud the poor.

01:51.210 --> 01:58.920
And you can see there is nothing on the first three columns we start to print at the fourth column and

01:58.920 --> 02:04.350
the first line, not if I put, for example, zero and one.

02:04.390 --> 02:05.370
Let's see what happens.

02:07.980 --> 02:14.160
And now you can see the HelloWallet is printing from the first column that's on the Seagram line.

02:15.170 --> 02:20.150
And now let's say I want to bring Telo in the first line and world in the second line, what I can do

02:20.420 --> 02:31.750
is send the cursor to zero zero or just not set it at all and then set Kyozo at zero one and then ency

02:32.750 --> 02:35.510
print world.

02:36.770 --> 02:39.530
Like this is from here.

02:39.980 --> 02:46.280
OK, hello on the first line here and world on the second line, let's bring that.

02:49.060 --> 02:54.610
OK, we have hello on the first line and what on the segment, so as you can see, when you change the

02:54.610 --> 03:01.600
course, so it will change the course of the next print, OK, to keep the text that is already on the

03:01.600 --> 03:02.070
screen.

03:02.320 --> 03:07.480
So it's very convenient to put some text somewhere and some other text elsewhere.

03:07.480 --> 03:10.660
And you can organize your display screen as you want.

03:11.080 --> 03:13.140
Now let's see, let's say, for example, I use.

03:13.150 --> 03:16.570
So I'm going to use a delay here just to wait for one second, OK?

03:17.200 --> 03:19.060
And let's say a print.

03:20.450 --> 03:21.040
Odili.

03:22.170 --> 03:29.400
So I bring Telo on the first plane and then they put the closer to the signal a print world, I wait

03:29.400 --> 03:32.420
one second, I print Ardino that see what happens.

03:35.840 --> 03:40.230
As you can see, Alino is printed just after what?

03:40.250 --> 03:44.960
OK, so whenever you print something that will also move the cursor.

03:45.020 --> 03:50.590
OK, so the cursor here is at zero one and then so it would be a zero in here.

03:50.930 --> 03:58.500
And then one one two one three one four one five one six one.

03:58.760 --> 04:04.880
So when you are here, it's like you have said the cursor to six one, OK, and now let's say I'm doing

04:04.880 --> 04:11.170
this acidy dot six cursor with zero one again.

04:12.170 --> 04:15.990
So now I'm forcing Newcastle to go back to zero one.

04:16.010 --> 04:17.270
Let's upload.

04:18.370 --> 04:20.380
And let's see what we get here.

04:21.400 --> 04:27.700
You can see Hello, world and in hello and we know, OK, the world has been replaced.

04:27.940 --> 04:36.280
So whenever you print some text, what it will do is it will replace all the previous text that was

04:36.280 --> 04:37.960
printed at the same place.

04:38.070 --> 04:43.990
OK, so here I said, of course, zero one, I bring some text and then I said, OK, just go back to

04:43.990 --> 04:44.710
the same place.

04:44.710 --> 04:48.940
I bring some other text so the previous text will be replaced.

04:49.420 --> 04:52.000
So now you know a little bit better how it works.

04:52.000 --> 04:58.600
And I really encourage you to do some experiment, OK, to print text in different parts of the city,

04:58.900 --> 05:00.810
replace some text, etc..

05:01.120 --> 05:01.630
And now what?

05:01.630 --> 05:03.520
We can do a nice application.

05:03.520 --> 05:11.170
Quick one is to so I'm going to keep Pelo on the first line and then to print a counter.

05:12.980 --> 05:21.570
OK, that's initialize a counter and counter these zero and in the look function, what I'm going to

05:21.570 --> 05:23.730
do is LCD said.

05:26.250 --> 05:30.430
So what I want to do here is print hello and then the counter.

05:31.290 --> 05:33.510
So I went you to set the console on.

05:33.510 --> 05:35.400
So this is column zero.

05:35.760 --> 05:38.190
One, two, three, four, five.

05:38.490 --> 05:41.700
And I want to add another space, so that would be six.

05:42.690 --> 05:46.580
I'm going to use six and then zero for the first column.

05:47.010 --> 05:52.170
So every time in the loop I said the cursor to six zero and then I do acedia print.

05:53.870 --> 06:00.140
Conter so I can bring a vegetable like this, it would bring the result of a viable and then let's do

06:00.140 --> 06:01.670
conter plus plus.

06:02.450 --> 06:09.530
OK, and let's OK for just because this is Conexion, let's add a delay of five hundred milliseconds.

06:10.280 --> 06:12.080
But with this we should be printing.

06:12.440 --> 06:13.060
Hello.

06:13.100 --> 06:16.340
One, two, three, four zero, one, two, three, etc..

06:16.610 --> 06:18.560
Let's load.

06:20.110 --> 06:22.270
The program and to see what it does.

06:23.350 --> 06:28.870
Hello, zero, one, two, three, and you can see the counter is increasing and every time the new

06:29.170 --> 06:33.040
number is replacing the previous one, why is that?

06:33.040 --> 06:37.720
Because simply we just put the cursor to the same place every time.

06:38.060 --> 06:42.040
OK, that's pretty much it actually, with just you can already do a lot of things.

06:42.340 --> 06:45.660
And just one final note if you want to clear the screen.

06:46.120 --> 06:49.470
So if you want to clear that onto your screen, we have no character.

06:49.480 --> 06:53.710
You can see the clear like this and this would clear the screen.

06:53.720 --> 06:55.630
So at any time of your program.
