Hi and welcome to a new section in this course, this section is dedicated to this place.
I'm going to show you how to use a series of displays such as this to buy 16 LCD display.
Very common.
I've got a graphics display like these, actually.
I've got a variety of graphics displays to show you, plus displays such as this eight by eight Matrix
and so on.
So in this first lecture and the one that follows, I'm going to show you how to use the very common
two by 16 LCD display, which contains a backpack like this one, which allows us to use it in cereal
ICQ, which see mode instead of its native parallel mode via those pins here.
So in my case, I have sold the backpack onto the display itself, and that makes it easier to use in
one piece as if there is one single module.
Now this module here just said contains the F eight five seven four integrated circuit, which makes
it possible to convert the displays native parallel interface into in a square C interface.
So I've got the wiring here set up and in this lecture I'm going to show you how to use the USB 32 hardware
I see in the face and in the next lecture will do the same thing, but will use a software interface
which allows us to use squishier with any compatible chips on the 32 instead of being confined to the
hardware.
I could see.
So the wiring in this first example is very simple for ground.
And this is see, I'm using the ground pens on the ground rail on my breadboard, and I'm using the
five volt pin on the speaker to say I'm just using this long red wire to take five votes into the FCC
on the backpack for state and SEAL because I'm using the E.S.P 32 hardware.
I could see this, too, had I switched to interfaces.
I'm using the one with ID zero.
I'm going to talk a little bit more about this in a moment.
I'm using pins 19 for a.D.A and 18 for a ACL.
All right, now let's have a look at the software side, so the software side depends on two libraries
that you need to download.
The first one is this one here, LCD on this call API P y, which contains some of the basics of the
functionality for the LCD display.
And then on top of that, we use the SBA to six six call I squared see on this LCD, which basically
builds top of the OCD and this score API with functionality that is specifically compatible with the
SBA eight to six six.
And it's an extension with our E.S.P 32.
So you need to get those libraries.
And I have the locations from where you can download them from here.
So these are the required modules that you need to download and install.
Apart from that, I'm using a few other bits and pieces here, for example, you need to import the
pins module and sleep, put a bit of delay their motor using the string formatter or the string formatting
operator, the percentage string, as you can see, percentage the string here to allow me to display
this number.
And it's increasing every second.
So I use the string formatter for that.
If you're not familiar with how to use it and have a look at this reference documentation.
Let's talk a little bit about Isaac we see on the especially to using micro python.
We've got a link for that here, specifically for the hardware interface that we are using.
This example, it would take you to this page here.
We are now looking at a quick reference for the E.S.P 32 in the macro Python website, and that is the
hardware squid seabass.
And you can see that the is 32 gives us two lots of atheel.
Is the HP use that implement the hardware I could see.
And in this example we are using I d zero, which means that the seal is on Jhpiego 18 and is the Orangeville
98.
And to create an ice quazi object on the hardware, I would say interface or you've got to do is to
tell Macra Python which ID it is that you want to use.
So that's all there is to it.
There's a single no single Idei as a parameter to the ice quartzite constructor will give us the ice
quazi object and that's what we do.
Right here.
After that, we take that Asgard, it's to see object becomes the first parameter in the constructor
for the LCD object in case it LCD.
The name that I've given to the module, you can see I'm importing the ISP a 266.
And this call I to see an LCD and I'm renaming it to this, which is a little shorter and easier to
use on words.
I'm using that as the name of the module.
I'm calling the constructor for the LCD, passing the object for the ice quazi that we created in line
for the two and also grabbing the default.
I could see a address.
I could have created a local variable with her address and just use this in here.
But I was taking a look at the.
Librarian, you can see that that address is already included in the in the library module.
So I was just able to get this constant and edit into my constructor like that.
And that meant that I didn't really need to have an additional line of code here.
I'll keep it here just for reference.
So after that, we've got the number of rose in the third parameter.
In the fourth parameter is the number of columns.
So if you have a different sized LCD display, then you can just change those numbers to match the size
of your particular box.
Could see this could have, for example, three rows.
Once we're done with that, we've got the object to go and clear everything in the display.
So prepare the display to write something on it, clearing the and creating the counter variable here
and giving it an initial value zero and will go into an infinite loop.
I can set the cursor on the Ill-suited to a particular location.
So this is a move to function, which you can see here.
OK, so starting this won't you, to API look through it in here.
All right.
So here it is.
So you can see that first goes the X coordinate and then the Y coordinate in the move to function.
So you've got X Y zero zero.
So it will go up to the very first block.
Can barely see it, but there's a block.
Right.
And then number two and will use they've put is the function to print out this text, this string of
text then will move to the next line down.
So X is zero and then Y one shot will go down here and print out this string of counter followed by
Percentage De, which is the string modifier for a digit, they say percentage sign here.
And then in parentheses I'm printing out the variable value counter, which I have just updated by one
each time we're going through the loop and we'll wait for one second if you sleep one, which I then
put it up here, it takes Sinisa.
Now, given the number of seconds that I want, you wait here and it goes back and repeats the loop
and that's about it that you can see.
It's fairly easy to use your LCD display using the square to see hardware interface to print changing
text or static text.
Let's jump into the next lecture where I'll show you how to use the software I took with C capability
that comes with macro python, which is useful if you just don't have access to the hardware which could
see interface for some.