Now that you can print some text with the LCD, let's actually play a little bit more with the functionalities
of this LCD screen and actually use the cursor.
So I will show you how to print text to print numbers in different places of the LCD because you have
16 by two, OK, which means that you can print text our character anywhere in these 16 by two matrix
here on the LCD screen.
So first, let's try to understand what happens when you do actually print why this is printed on the
top left.
OK, there is a function actually that you can call is L.C that sets Chiuso should arrange and you can
set the course also the sort of where it's going to print the text.
And the first parameter is the number of the column.
So you can go from zero to 15.
OK, so you have 16 seconds from zero to 15, let's say zero, and then the number of the line.
So line zero, line one.
OK, there are two lines, so let's put zero and zero.
So when you set the cursor to zero and zero, that is the default behavior and that's what you are going
to get with this.
OK, so when you don't put this line, it's just like you have said the cursor to zero and zero.
OK, now let's change this.
Let's change.
Let's put three here.
So we are going to start to set the Khutsong and the three, so the fourth column and the first line,
let's see, we don't applaud the poor.
And you can see there is nothing on the first three columns we start to print at the fourth column and
the first line, not if I put, for example, zero and one.
Let's see what happens.
And now you can see the HelloWallet is printing from the first column that's on the Seagram line.
And now let's say I want to bring Telo in the first line and world in the second line, what I can do
is send the cursor to zero zero or just not set it at all and then set Kyozo at zero one and then ency
print world.
Like this is from here.
OK, hello on the first line here and world on the second line, let's bring that.
OK, we have hello on the first line and what on the segment, so as you can see, when you change the
course, so it will change the course of the next print, OK, to keep the text that is already on the
screen.
So it's very convenient to put some text somewhere and some other text elsewhere.
And you can organize your display screen as you want.
Now let's see, let's say, for example, I use.
So I'm going to use a delay here just to wait for one second, OK?
And let's say a print.
Odili.
So I bring Telo on the first plane and then they put the closer to the signal a print world, I wait
one second, I print Ardino that see what happens.
As you can see, Alino is printed just after what?
OK, so whenever you print something that will also move the cursor.
OK, so the cursor here is at zero one and then so it would be a zero in here.
And then one one two one three one four one five one six one.
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
this acidy dot six cursor with zero one again.
So now I'm forcing Newcastle to go back to zero one.
Let's upload.
And let's see what we get here.
You can see Hello, world and in hello and we know, OK, the world has been replaced.
So whenever you print some text, what it will do is it will replace all the previous text that was
printed at the same place.
OK, so here I said, of course, zero one, I bring some text and then I said, OK, just go back to
the same place.
I bring some other text so the previous text will be replaced.
So now you know a little bit better how it works.
And I really encourage you to do some experiment, OK, to print text in different parts of the city,
replace some text, etc..
And now what?
We can do a nice application.
Quick one is to so I'm going to keep Pelo on the first line and then to print a counter.
OK, that's initialize a counter and counter these zero and in the look function, what I'm going to
do is LCD said.
So what I want to do here is print hello and then the counter.
So I went you to set the console on.
So this is column zero.
One, two, three, four, five.
And I want to add another space, so that would be six.
I'm going to use six and then zero for the first column.
So every time in the loop I said the cursor to six zero and then I do acedia print.
Conter so I can bring a vegetable like this, it would bring the result of a viable and then let's do
conter plus plus.
OK, and let's OK for just because this is Conexion, let's add a delay of five hundred milliseconds.
But with this we should be printing.
Hello.
One, two, three, four zero, one, two, three, etc..
Let's load.
The program and to see what it does.
Hello, zero, one, two, three, and you can see the counter is increasing and every time the new
number is replacing the previous one, why is that?
Because simply we just put the cursor to the same place every time.
OK, that's pretty much it actually, with just you can already do a lot of things.
And just one final note if you want to clear the screen.
So if you want to clear that onto your screen, we have no character.
You can see the clear like this and this would clear the screen.
So at any time of your program.