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 today's video, we're going to use an LCD screen so that an Arduino board can tell you something.

  • One of the big issues that comes up in the world of Coyote is basically how is the Arduino supposed to communicate with the human being and say whatever the hell it isn't used to say?

  • Sometimes we use led lights.

  • If the lady is green, you know everything is okay.

  • If it's red, you know you should probably do something.

  • Sometimes you use buzzers.

  • You know again, it's buzzing.

  • One way you're buzzing the other, you know, if that is good or bad.

  • Sometimes if you have a network interface shield for hard, we know you can actually go to an I P address, and you will be the embassy, essentially a website, and you'll be able to get information that way.

  • But what if you want to simply be ableto read information from yard?

  • We know something like, let's say like an I P address.

  • So if you have a network shield for your Arduino project, and it uses D A C P well in order to interact with that device once it's on the network.

  • Everyone you need to know its I p address there's a big problem is a big problem.

  • This thing grabs a D a C P address, and you're not really sure how to figure out what address it grabbed.

  • You might run into some problems, so what you could do is you could turn that I p address into a value for variable and then print the value of that variable that I p address out onto an LCD screen.

  • So basically, being able to use an LCD screen like this is a way for the art we know to give you text information.

  • So things such as what is the I P address that it pulled or if you're looking for things, we do a lot of temperature sensor projects here, So if you actually need to know what a specific temperature is, what is the specific temperature, then it can print out on a screen like this.

  • So this is a way that the yard we know can print out very simple text information, and it's a great thing to know how do again, because there's a lot of these more complicated projects.

  • And again you get the point.

  • Your little device grabs a D.

  • A C P address, and you're like it's connected to an hour.

  • Anybody haven't I p scanner, so I can figure out what the hell they be addressing this devices.

  • I'll be nice.

  • So So having a screen like this could be great.

  • Let's go over the workbench and I'll show you the components that we need for the project.

  • How to build a project to be code for this particular project.

  • And, uh, yeah, So for this particular project, we're going to need our LCD screen.

  • So this is a 16 column by two row LCD screen.

  • It's pretty pretty standard in the Arduino world.

  • Of course, we're going to need a bread board in order to plug the screen into it.

  • We're gonna be using our we know, you know, bored.

  • Now, with this particular project, you can use a lot of different artery no boards in order to drive this type of screen.

  • But do make sure you have enough digital pens because you actually need quite a few digital pins in order to make this thing work, then we're gonna need is we're gonna need a 220 ohm resistor.

  • We're gonna eat that.

  • And then we need something called a potentially ometer.

  • So basically, this is a variable resistor as you as you twist the little knob that changes the resistance.

  • And so this is going to be used in order to change the contrast of the screen so that push that aside and tell you Look.

  • Oh, take a look at this broad.

  • Yes, this broad has got a lot of wires in it.

  • This is one of those You sit there, you go really, really requires that many wires and yes, yes, In fact, this little thing just again, you'll notice there's no sensors.

  • There's nothing else to the project.

  • Literally.

  • Just to get this screen to run, you're gonna need 66 digital pens.

  • We're gonna need the power and potentially ometer the whole nine yards.

  • So basically, we have the digital pens.

  • Here's the digital depends here.

  • Go to the penance for for the screen, the screen simply All you do is you you shove it in here.

  • You slide it down and then the digital pens Ugo and there's little letters.

  • There's actually little letters on the screen, little letters and numbers.

  • And so you put the pens to the corresponding pins on the particular screen.

  • Then, of course, we're gonna use the resistor up here.

  • So there's Here's where have the resistor.

  • We have a couple of different power connections, so we have negative over here.

  • We have negative here.

  • We have negative here.

  • We have positive here.

  • And then the one thing we have down here, it's kind of interesting.

  • Is this is that potentially honor so potentially ominous can look a lot different.

  • This is a potentially our murder I got in the yard.

  • We know Starter pack.

  • I found it just to be a little bit of a pain in the butt to use.

  • So this is the potentially ometer.

  • I particularly like this goes in here sideways so you can twist it this way, basically, with potentially honor.

  • What happens is you have positive and negative coming into potentially ometer and in the middle pen.

  • The middle pen is whatever the variable resistance is that you give it.

  • So basically as you change us.

  • This changes the current, and so this then goes to a particular pin on the LCD screen, and this is how it's all set up again.

  • This is one of those don't don't try to build this off of trying to look at the picture.

  • Do go to the diagram.

  • Actually, take a look at the diagram because there's a lot of different wires here.

  • And if you get anything wrong, it won't work properly so that let's go over, take a look at this sketch to see how this thing works.

  • So here is a basic sketch in order to make the LCD screen work.

  • The first thing that we're going to need to do is we're going to need to include the liquid crystal library.

  • So this is the LCD library.

  • This gives all the functions and everything that's required in order to make a sketch using an LCD screen work during a new pound include liquid crystal dot for that library.

  • The next thing that we're going to do is we're gonna define all of these pins, so these are all of the digital pens that are going to get connected to the LCD screen.

  • We have named thes particular pens based off of what they're called on the LCD screen.

  • If you look at the LCD screen, you will see there's a pin called Rs.

  • A pin called Vienna Pete been called D 45 67.

  • So all we're doing here is we're actually calling this pin by that name within the sketch.

  • And then Now what we know is we We know that digital pin number 12 needs to be connected to the R.

  • S.

  • Pen on the LCD screen.

  • Digital pin number 11.

  • These be connected to the E in the pen on the LCD screen five D four so on and so forth.

  • So this is where we define all of those different pens.

  • Then we're going to go down here and using the liquid crystal library.

  • We're going to use LCD, and then basically, we're going to plug in all of this information.

  • So this is what the LCD screen needs in order to be able to function, to know where the pens are, and so we just simply plug this end.

  • And now the LCD screen is basically set up.

  • We then go down to avoid set up, and the first thing that we're going to need to do is we're going to need to actually begin the LCD service.

  • So we need you tell the art we know kind of sort of what an LCD screen we have.

  • And so what we have here is we have LCD dot begin.

  • So this is getting the LCD service and they were telling it what kind of LCD screen it ISS So this is a 16 column.

  • So basically, this means you have 16 characters going across to row, and so you have to roast, right?

  • And so you have to tell the Arduino in the sketch again what kind of LCD screen it is so that when we go down and we actually start telling it where two prints stuff, it knows what to do.

  • So we're telling that here it's a 16 column to row LCD screen.

  • They know we're gonna D'oh right here is we're just going to print out something on the screen.

  • So we go to the loop, And so what we're going to do first is we're going to do LCD dot set cursor.

  • So what set cursor does?

  • Is it says, Where do you want to start?

  • Typing?

  • Act?

  • All right, so you have a screen.

  • So you have 16 columns to rose.

  • So you have to say, OK, where where do I actually want this printed out at on the screen.

  • So what we're going to say is that we want this on the third column and I say you go.

  • Well, wait a minute.

  • The third come with the LCD screens.

  • Numbering starts at zero.

  • So it 01234 So the first position is actually number zero.

  • So what we're saying here is we wanted to start in the third position.

  • So as far as the LCD screen is concerned, that is number two.

  • So it 012 comes to three.

  • So that's just something to keep in mind.

  • So it starts at zero.

  • So if we want to start the word, But if we're going to say at third position, we say to and then we're going to say what ro do we want it to be printed on it?

  • So we wanted to be printed on a zero because zero is position one, So we're going to say OK on the third column of the first row.

  • And then we come down here and we do l C d dot print function, and we simply say hello.

  • So LCD print parentheses, double quotation marks.

  • Hello, or you could get a variable value in here.

  • Whatever else close it out, then we're going to do is LCD dot set cursor, and then we're going to go to the ninth position.

  • So we're going to use number eight.

  • But that's actually 9012345678 is the ninth position on the second row again, even though the number is one that corresponds to the second row.

  • And then what we're going to do is, you want to say l c d dot print?

  • So the good old fashioned a hello world, and it's going to be on a different, a different life.

  • And so with that, let's let's upload the code and I'll show you how this works.

  • So the code has been uploaded.

  • I will just simply plug this thing in so we have power.

  • This thing boots up and twist.

  • Oh, look at that.

  • Hello world again.

  • As I said that before, this is the contrast So if you twist this well, come in.

  • And there we go.

  • And so that's basically all all we have to this particular particular project into this particular sketch.

  • So, as you can see here, right, And if we change yet you can see all the cop.

  • See how I say 16 columns of 12345 So each one of these characters is considered a column to roll Rose and so at the third position.

  • So that's number two.

  • So two equals the third position.

  • We start hello and it prints out Hello, then at the ninth position again when we write it in its eight.

  • So 012345678 Right, So at the ninth position, we start World World is printed there and we have hello world on again.

  • Like I say, we tweak around with potentially ometer We could bring it and we can take it out.

  • That's basically all there is to making the LCD screen and work.

  • So that's all there is to connecting and encoding for an LCD screen on an Arduino again, This could be very valuable for projects.

  • If you need to know no specific information from the army.

  • No board if you need to know a specific temperature or you need to know again joking I p addresses.

  • The address is there is nothing so painful as as devices you connect to the network that grabbed the http addresses and you have no idea what the hell address God, it's connected to the network.

  • I don't know how to communicate with it, though, so I have a little screen on your board that is just a very valuable way to be able to again be able to get this kind of basic information.

  • You can also use these in order for screens and have whole like menu type interfaces so you can add buttons to your project.

  • So let's say something is reading out on the screen.

  • You could push one button and that will give you a disc different screen.

  • You could click another budget may be trying to change the configuration.

  • So again, let's say you have something like a network shield for your device.

  • So on this, it could say an I P address.

  • You could literally have something where you press a button, and then it shows you with sub net mask is and the press a button and shows you what the what the default gateway is and the the D.

  • N s and all that kind of thing.

  • And then you have a different button where when you press it and then tries to release and renew the D.

  • A.

  • C P address.

  • So these were some of the things you can start thinking about once you add LCD, screen your project.

  • And again, this is an important thing to be thinking about with Arduino projects is how how is the device communicating with the end user?

  • It's not simply valuable enough to have the sensor and have the art.

  • We know board know what's going on, but you actually have to communicate something to the users.

  • And so you have to start thinking about you know what's best is an led light.

  • Blinking best is a buzzer blinking best is some kind of specific information best because that's the kind of thing you can have on here, right?

  • So if if if some sensor gets triggered, not only could he have an alert go off, we could literally have you no call.

  • Call Bob now or a call, Bob and actually have Bob's phone number come up.

  • You know, that's the kind of thing that you can actually plugged into your head.

  • We know to make life a lot easier.

  • You know, I'm sitting there.

  • It's like, Oh, the server rooms too hot.

  • What do I do when there's like a little red led blinking?

  • And then literally, you could have a screen that says, You know, a server room overheated.

  • Call Bob.

  • Here's his phone number, right?

  • That's a kind of interesting thing that you could do with these kind of screens, the type of thing you have to be thinking about having.

  • How is the best way for your project to be communicating with the people that are going be interacting with?

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.

字幕と単語

ワンタップで英和辞典検索 単語をクリックすると、意味が表示されます

A2 初級

Arduino上の16 x 2 LCDスクリーン (16 x 2 LCD Screen on Arduino)

  • 2 0
    林宜悉 に公開 2021 年 01 月 14 日
動画の中の単語