Paul McWhorter arduino lesson 25
Now, if you’ve been with us through the most excellent first 20 lessons, we have taken you from the point that you can install the operating system and get the thing booted up in the terminal window, all the way through sort of an overview of Linux. So you can kind of get comfortable with the Linux system and then, finally, in lesson 24, we went all the way to writing your first Linux. Writing your first Python program from the Linux terminal, and so at this point, which sort of taking you to the point that you can write a Python program now, if you’re not familiar with Python I’m, not going to be actually teaching you how to run Python. But if you go back and look at our earlier lessons shown here at top tech boy, comm using Python with Arduino, we sort of show you the in a little bit of the ins and outs of Python. So if you need to learn Python, I recommend you go back and take that series of lessons. Ok, but we are now ready to start doing some neat things, we’ve sort of learned, the basics of the raspberry pi. We know how to get around we’re ready to start doing some projects. Well, if you remember the Arduino, this is an Arduino Nano that really the whole thing about using the Arduino is the ability to control voltages, apply voltages to or revolta jiz from all of these different pins, ok and that’s sort of what distinguishes the Arduino from, like Your desktop computer, you actually have pins that you can do something with you can send signals to them.
You can read signals from them. Ok, then we step up to the Raspberry Pi and it has a whole lot of pins. Ok, so if we’re going to start doing projects, we got to kind of figure out what those pins are. So in this lesson, what we’re going to do is kind of understand. The pin out of the Raspberry Pi it’s a little bit more complicated than the than the Arduino, and so what I want to do is I just want to spend one lesson, just kind of getting you up to speed on the on the pin out for the Raspberry Pi, ok to follow along with me. Why don’t you go to top tech boy comm, because you place see it better on the website than on the screen. If you go to Raspberry Pi line x lessons, and then you come down to lesson number 25. What I have done is I put together a nice pin out if I can click on that, get it to come up, bigger all right and that’s, probably pretty good right there. Hopefully, you can see it if not just go to the website. Now I made this chart myself, I didn’t just go copy and paste from you know something on the internet. No, I made this custom just for you, so let’s see how this thing goes. The first thing that you see is is that there is a lot of pins on here. Let’S see it looks like there are 40 pins altogether, 20 rows and 2 columns, and so on the Raspberry Pi model 2.
We have 40 pins. I think on some of the earlier ones we might just have 26, but what I do believe is. I do believe that they are numbered the same that they have the same function and then, just if you have the model 2 or a newer model, you get these extra pins, but this this pin out should, I believe, work for most of your raspberry PI’s. Okay. First of all, let’s kind of look: this is this is kind of busy and so let’s uh let’s get a feel for it again. You see two rows and you see 20 columns. Well, first of all, you can see that there’s, a couple of old friends that you’re going to be needing. If you look first of all, I guess I should say how are these things numbered they’re numbered like this. The physical numbering is, the upper left is pin 1 pin 2. Then you come back 3. 4. Then you come back 5. 6. Then you come back 7 8 and you can see that here. 1. 2. 3. 4. 5. 6. 7. 8. So these two columns are just a picture of this with the physical pins listed and those fiscal pins go one through 40 over here on my raspberry pi. Therefore, you could see that configured like this. This would be pin 1 right up here in the corner and then this one over here would be pin 2 and then pin 3 and then pin 4 and on down like that.
So it’s a little got to think a little bit because they are not numbered, at least on the more recent raspberry PI’s. There is no number alongside the pins. You’Ve got to kind of do this. If you go to my website and you’re going to be working through these projects, it might be good to just sort of click on this and then print it out and you’ll tape it on your wall. So you’ve got it handy. Okay, so we have physical pins. 1 through 40 that’s 1 through 40. There are two ways remember in Arduino when we did our pin modes, we sort of set up the pins using pin mode well, there’s kind of analogous commands that we’re going to learn in Python for doing that. Same type of thing, but what we’ve got to do in the configuration and our Python program is we’ve, got to figure out or we’ve got to decide what numbering system we’re going to use. There’S the physical pin numbering system where this would be pin 1. 2. 3. 4 and you just give it a physical number or you can configure it to what’s called BCM, which is like Broadcom, something or another, which is a different way of configuring them, and then what this would be is. This would be GPIO for general purpose: input, output, GPIO 3, 4, and you can see that there’s, this kind of different configuration if you use the BCM numbering as opposed to if you use the physical numbering and in the next lesson when we go in and start Writing a Python program we’ll show you how to show you a little bit more detail about that, but for right now what you just need to know is there’s two different numbering systems which one you use will be defined at the top or sort of the set Up part of your Khaitan program, now let’s look at some of the useful things that we first of all, you can see our old friend a 5 volt rail.
You can get 5 volts off the PI from pen 2 or pin for physical pins. That is, you can get 3.3 volts from pin 1 or pin 17 okay that’s kind of useful, and then you can see, pin 25 as a ground pin 34 as a ground 20 as a ground and 14 as a ground. So we have got a lot of different grounds and power supplies, or you know, power power points that we can get off of these time off of these pins. Okay, what I would say is these GPIO pins are sort of like your your aunt, your your Arduino digital pins. You can write a high or a low to them or you can read a higher low from them, so their general purpose, input and output. They tend to be more digital we’ll, get into this a little bit more a little bit more later, but you can see that these are your GPIO pen, so you’ve got a whole lot of pins a whole lot more than you do on the Arduino. Ah, the thing is: what I need you to see, though, is some of the pins are multifunction? So if you look near pins 29 through 37 they’re, just GPIO, pins, they’re, just general purpose input or output pins. But if we look at 10 3 amp 5, you could use those as GPIO pins or you could use them for I to C similarly pins 8 and 10.
You could use for GPIO 4, pins, 14 or 15, or you could use them as TX and rx for a UART. Okay, if you wanted to do serial communication also, you can see that 19, 21, 23, 24 and 26 can be used for SPI, okay and and they also could be used for a general purpose – input output. This is what I like to do if I’m just going to turn an LED on, or I just want a 0 or a 5 volt signal. I try to use one of these. That is not a that is not a GPIO, is not a multi purpose. Okay, I try to use one that is not a multi purpose, and the reason is is that if I wanted to come back later and let’s say, I got something neat going on and wanted to come back later and do TX and rx. I don’t want to have those thing figured for something that could be done on other pins, and so I tend to kind of hold these back and hold my SP I and i2c pins back. If I can, because you never know if you might need them in the future, okay let’s see here, I don’t see anything else here that I probably I probably just need to stop here and then start covering the next thing. That we’ll do is in lesson: 26. We’Ll, come in and start building a circuit and start seeing. How can we do something simple with these pins, like like input and output? What I will say, though, is, is that one thing that you will notice, which tends to be kind of a brick wall that were that were that we’re going to hit here.
These are all digital input, output, pins. Now we can load some libraries and we can get them to do PWM, which can kind of act like an analog output and that’s really the same thing. The Arduino does on those pins that have the squiggly that’s, not true analog output. What that really is, is it’s pulse width, modulation, where you’re just sort of controlling the timing that you leave the pulse up and down and create an average value that works for that works for most things and so that’s the way the Arduino works. You can load libraries where you can do pulse width, modulation, kind of simulate, analog output on these cheap at GPIO pins, however, and this is kind of a biggie, what we are missing on the Raspberry Pi is. We are missing the analog input pins. We don’t have a way to do analog input like if you want to measure a voltage between 0 and 5 volts. You don’t have a way of doing that on the Raspberry Pi and so what they do in Raspberry Pi projects is they sort of show? Oh, you can use this chip and then you run the things into the chip and then you talk to that chip with the Raspberry Pi Wow. At that point I would probably just plug a Arduino in and have the Arduino do, the analog input and then just talk have the Raspberry Pi control the Arduino, because you can get some of these Arduino ‘z for probably under 10 bucks, and so, if I’m, really Going to need to do something like analog input.
What I usually do is I usually just tack up. I on there write a simple program in PI and then have I mean in Arduino, write a simple program in Arduino and then have the Arduino interacting with the Raspberry Pi and control with Raspberry Pi, so first major kind of roadblock or brick wall we’re going to Run into with the Raspberry Pi for all the things we absolutely love about it, it doesn’t have analog inputs, ok tune in for lesson number 26, where we’ll actually go in and start writing. Some writing some code. Writing some Python programs that will start interacting with these pins, pulmicort top tech boy comm. If you like these love lessons, give us a thumbs up, think about sharing them or subscribing to the channel.
Paul McWhorter arduino lesson 25 Video
Paul McWhorter arduino lesson 25 news
Posted on Friday August 19, 2016Books You Should Read: Basic Electronics Hackaday … Continue Reading »
Paul McWhorter arduino lesson 25 Social