Placeholder Image

字幕列表 影片播放

  • please go to the line the computer guy dot com, in order to view schematics, code and Maur for the projects that you are learning about.

  • Welcome back.

  • So in this video, I'm going to show you how to add an eye to see LCD screen to your artery.

  • No problem.

  • So in the past, we've used normal LCD screens on, and these work well.

  • But the problem is, is that they're a little bit complex to at the yard.

  • We know project.

  • You have a lot of pins connect to connect yard.

  • We know board.

  • You have to use resistors.

  • You have to use a potentially ometer.

  • There's a whole lot that goes into using a normal LCD screen on a cool part about using an eye to see screen is you simply have four wires to connect.

  • You have the five old for power.

  • You have the ground, you have to communication wires, and essentially, that is it.

  • You don't have this whole mess of wiring to make one of these I to see screens work, And so that's why it makes life a lot easier to use these types of screens.

  • So with that, let's go over to the work bench so I can show you how to connect one of these to an Arduino board.

  • Then I'll go and I will show you the sketch and the code to make one of these things work.

  • And then I will bring it all together for you.

  • So this is our eye to see display connected with Arduino.

  • So with this, we have a 20 by four LCD screen with the eye to see controller board on the back, and we simply have this connected to a standard Arduino Uno board.

  • Now, for comparison sake, this is a 16 by two LCD screen, and, as you can see, if I flip it over, you can see these are all the pins that normally have to be connected to your Arduino project.

  • So if you take a look at the 20 by four screen, what you'll notice is it has basically the same pin out as the 16 by to display.

  • But those pens are sauntered onto this eye to see controller board, and so this eye to see controller board then controls the communications with the pets.

  • Beyond that, when you take a look at the back, there's a little potentially ometer here.

  • This is used for the contrast.

  • So if you can't see things on the screen, screw that one way or the other.

  • And that may help with contrast.

  • But basically, this is what you've got when you're dealing with an eye to see screen.

  • So when you take a look at it, we have the markings on the backs you have ground eso won wire goes to ground on your Arduino, you have the VC.

  • See, another wire goes to your five gold on the Arduino, then you have SDA.

  • So SDA then goes to the A four port and then you have s C l that goes to the A five port.

  • So for this project that I'm going to show you, we're not actually defining wth e analog ports within the sketch itself.

  • So make sure that you connect the SDA and the S C L to the correct ports.

  • Don't put them willy nilly on one of these analog ports and then think that you're gonna change it later.

  • Make sure put sda right now, put that to a four and put S c l to a five and that's it was really nice.

  • Literally all is required in order to make this screen work.

  • We know.

  • So with that, let's go over the computer and I can show you how to write the sketch in order to do a basic hello world sketch for this.

  • So here we have the sketch for this particular project.

  • Now, the first thing that you're going to see is that we are including two libraries.

  • I want two important things with these two libraries the LCD dot take liquid crystal underscore to see is that these libraries do not come with Arduino by default.

  • You actually have to download and install them.

  • So if you go over, there's the liquid crystal eye to see libraries.

  • You come here and you can download at the library from here.

  • And then you have the the new liquid crystal library here.

  • If you go down to download, installation or hearing finally depository and you can download the library from here, so you will need thes to libraries in order to make this project work in orderto actually install the library's.

  • Once you've downloaded them, you go to sketch include library.

  • You go.

  • Go ad dot zip library from here you go to whoever you're.

  • The ZIP file is Ugo and then you're able to select library.

  • And if you sit it chews, it will then install it into your Arduino i e.

  • Now it is important to understand that has to be a zip file and cannot be a normal folder s o.

  • If you don't have the folders it for some reason, you will simply have to compress it and put it into a zip format.

  • Once it's been installed, we go up to sketch.

  • We goto include library.

  • We should be able to go down here.

  • We could see contributed libraries.

  • So these air the additional libraries and so we can see the liquid crystal underscore to see library here and the new liquid crystal underscore live here.

  • So we have to make sure those two are installed for this project will not work, eh?

  • So we add those Leiber's we include those libraries that we're going to go down and we're actually going to create the LCD screen so that the Arduino knows how to communicate with this device.

  • And so we're going to use liquid crystal underscored eye to see, and then we're going to name this LCD.

  • So simply LCD.

  • Whatever you wanna call it.

  • You call of that?

  • So we're calling this LCD, and then we're going to refer to it down here and the rest of the code using LCD.

  • Now for the rest of this between the parentheses, most of this we're not gonna mess with or worry about, at least at this point.

  • But the one thing that there may be a pork with is this.

  • This is the hex.

  • A decimal address for this eye to see display.

  • So it's important.

  • Understand that I to see is an addressable communication protocol.

  • What?

  • That means he has multiple devices.

  • Could be on the same wires, But then the yard, we know, can communicate with the different devices by communicating with a specific address.

  • So I kind of think of it like an i p address.

  • So computers on a network, they often i p address.

  • And so you communicate with a server by going to a specific I P.

  • Address.

  • Well, kind Think that the same way.

  • Only they use hexi decimal addresses.

  • So with eye to see, uh, as I understand it, using a 77 bit hex address.

  • You could put up to 112 devices basically on the same wire.

  • And so you need to know what address your devices in order to communicate with it.

  • So just like if you don't know what an I P addresses for a network device, you're not gonna be able to connect to it.

  • You don't know what the heck's a decimal addresses were I to see device, you're not gonna connect with it.

  • The nice part is, is zero x to a seven should be at the default I to see address for the device that you'll be connected to your do we know.

  • So if you buy a new LCD screen, you plug it into our yard.

  • We know bored, and you don't have any other eye to see devices zero x 27 should work for you if it doesn't work for you or if you have multiple to see devices, you can do a Google search for sketches that will show you what I to see.

  • Devices are connected to your art.

  • Bueno.

  • So basically you go.

  • You download an example sketch, you upload it to you, aren't we know board and then When you run it, you go to the serial monitor and then it will show you the addresses of the high to see devices that are connected.

  • Yard we know, kind of Think of it again in the I p world of some kind like network mapping software.

  • Same type of thing.

  • And so, if you run one of those sketches, it will show what I to see.

  • Devices are connected to your do we know, and then you'll be able to find the address, used that address and plug it in here.

  • So hopefully hopefully for you, zero x 27 will work.

  • If not, it's a little bit more complicated.

  • Just just realize you'll have to run a sketch in order to find the addresses for the different eye to see.

  • Devices that are connected to you are we know so then passed that we're going to go down and we're going to go in and set up.

  • You will notice for this particular project we're not bothering with Loop.

  • We're just going to set everything up, sending up the environment, and then we're going to print everything out once to the screen.

  • So the first thing that we need to do here is we actually need to begin of the LCD screen LCD dot begin and then we need to say what kind of LCD screen it ISS.

  • So is it a 16 by two?

  • Is it a 20 by four?

  • So on and so forth.

  • So the 20 or 16 that's how many characters across.

  • So we have a won t character across by four row screen, so we have 20 comma four.

  • So if you had 16 by two, you put 16 to and that's that's all you do that's all you do is plug yet Then the next thing we do is weird to say whether or not we want the back light turned up to this LCD screen has a backlight you wanted on if so sexually copy and paste this LCD period of setback like pin to three positive and then LCD set back like too high to basically what this code does right here is it turns the back light on.

  • If you don't want the back line on, you can simply remove this code.

  • Then the next thing that we're gonna do again, just like when we're dealing with LCD screen for the past.

  • We have to set where the cursor is going to be.

  • So basically, we have to say this is where we want the curse to be.

  • And then we went to print out whenever we're printing out past this cursor and remember, whatever we're dealing with LCD screens, one is here.

  • And so the first position is actually zero.

  • So you run into this allotment Computerworld, where the first position is zero.

  • The second position is one.

  • The third position is too so on and so forth, it gets a little confusing to the head.

  • Just just remember that a lot of things start with zero they don't start with.

  • So for this what we're going to say we're going to say the first row, the first column of the first row eso this here.

  • This is the column.

  • So this is the character, right?

  • So the character across and then this here is the row were going to say in the first position of the first row, we wanted an LCD dot print Hello?

  • We're gonna set because cursor all the way up in the upper left hand corner 00 And from there we're going to print.

  • Hello?

  • Then we're going to LCD docked Set cursor to zero.

  • So the first, the first column, the first character of the sac n drove one is the second row and never got new LCD dot print This is so this will be printed out on the second row.

  • We're going to do LCD set cursor to the first position, zero of the third row, and then we're gonna LCD not print and I to see display, then just gets to shake it up a little bit here.

  • We're going to do, We're gonna go to Elsie.

  • Dude, LCD not set cursor.

  • And they were doing for.

  • So this is the fifth position.

  • So it starts at 001234 says that the fit position across so fifth position across on the fourth row.

  • So basically, basically, what I'm doing is I'm centering this.

  • We're going to do L C D print kind of cool period, period, period, and then we're going to end the loop.

  • And so this is going to print all of this out to the screen on so we can actually see something on our screen.

  • So let me upload this code and power it on and I will show you how it works.

  • So this is what the project looks like when we're finished.

  • So we have Hello world.

  • This is Colon and I to see display.

  • And then we've kind of centered that kind of cool, right?

  • So hello, world.

  • So we have this a 00 position.

  • So the first column of the first row is 00 and this is this is at 01 position.

  • So the first column of the second row, then we have an I t i to see display.

  • So this is zero to so that made the first column of the third row.

  • And then we come down here to be kind of cool, So I put the kind of cool in the middle, and how we do that is we start this again at the fifth position, so that's actually four.

  • So the fifth position is actually four because we started zero on the fourth row.

  • So we'll put a three and we put the kind of cool there.

  • So that's that's what we're looking at with this.

  • And so basically, this simply gives you an idea of how to use one of these I to see LCD displays.

  • It shows you how easy it is.

  • I mean, just the ability to connect using four wires.

  • Compare Thio what's required on a normal LCD screen.

  • This this is just a beautiful thing, and it really is pretty, pretty simple to set up as long as you're able to download the libraries.

  • So there you go.

  • That's all there is to connecting an eye to see LCD display to your Arduino project and writing some code abs right in some code in order to be able to write out to it.

  • Now, one of the things that I will tell you is not only is that a hell of a lot easier to actually use an lt helps to see display for your project, but it's also easier to find and by eye to see displays.

  • So I was kind of surprised when I went out there originally and I bought a lot of components for mired.

  • We know projects all the LCDs see displays that I saw and goodbye at the time, or all these older types that have all of the connectors that you actually have to connect to you, aren't we?

  • No board.

  • But then, as I've been doing this series of videos and I've been trying to figure out what displays to actually show you how to use and which ones to buy for the projects, one of the things that I've noticed is it seems like everybody's gone over to the whole eye to see configuration anyway.

  • So it's one of those where one I to see is a hell of a lot easier to use, and two I need to see is a hell of a lot easier to find.

  • So it is good to understand how to use the standard LCD display on an Arduino project.

  • But if you're gonna go out there and be building your own art, we know project with displays it is most likely not only gonna be easier for you to set up an eye to see display, but when you go to buy them, it's probably gonna be a lot easier to actually find them with the eye to see.

  • Control are already built into it.

  • So it's kind of one of those.

  • One is just easier to dio, and two you're probably gonna have to use it anyway, so you might as well figure out how to use an eye to see display.

  • So anyways, that's really all there is to these particular displays again using LCD displays.

  • Four yard we know projects could be a very useful thing, not only for the simple things of showing you where the temperature is in that time a deal, but again, when you go into star building, little projects do things like network testing to be ableto have your artery no product.

  • To be able to give you a lot of information on one screen will be very valuable for you.

  • So, as always, I enjoy doing this video and look for to see what the next one.

please go to the line the computer guy dot com, in order to view schematics, code and Maur for the projects that you are learning about.

字幕與單字

單字即點即查 點擊單字可以查詢單字解釋

A2 初級

在Arduino上的I2C 20 x 4 LCD顯示器。 (I2C 20 x 4 LCD Display on Arduino)

  • 3 0
    林宜悉 發佈於 2021 年 01 月 14 日
影片單字