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

 

 

 

 

 

 

 

Paul McWhorter arduino lesson 25 Social

 

 

 

 

official.arduino
2019-10-28T18:46:20+0000

We’re opening the Arduino IoT Cloud to other platforms, starting with the ESP8266 by Espressif Systems — NodeMCU, SparkFun’s ESP Thing, ESPDuino, and Wemos (to name a few) — along with other inexpensive, commercially available plugs and switches based on this module.
safe image.php?d=AQB6YIkvOaOwGAQg&w=720&h=720&url=https%3A%2F%2Fblog.arduino.cc%2Fwp content%2Fuploads%2F2019%2F10%2FDSC00029 - Paul McWhorter arduino lesson 25
official.arduino
2019-10-28T17:47:41+0000

How fast can you run the 40-yard dash? Find out with your own wireless timing gate system.
safe image.php?d=AQDAnlSUYJivJY5S&w=720&h=720&url=https%3A%2F%2Fhackster.imgix.net%2Fuploads%2Fattachments%2F1008638%2Fblob mOWHBn2WBw - Paul McWhorter arduino lesson 25

 

 

(Visited 10 times, 1 visits today)

About The Author

You might be interested in

Comment (14)

  1. +Paul McWhorter Can you please make a Video how to use gpio physical Pin 3 Or 5 as gpio or the second function?

    Thank you

  2. According to the information I am finding online, the pin numbering for the Pi A+ / B+ and “Raspberry Pi 2” (all with 27 pins) is VERY different than for the Pi 2 Model B and newer (with 40 pins). On the early models the numbering is NOT sequential, but seems to jump around out of order as compared to the sequential, orderly numbering shown on your 2 Model B here. This site explains it : https://www.raspberrypi.org/documentation/usage/gpio-plus-and-raspi2/

  3. It seems you are beginning to lean to an assumption here, that people following your tutorial are already experienced at using an Arduino. I ask that you avoid that assumption as I am sure there are others beside myself who are not fluent in Arduino. I played with one a little, and then moved on to the Raspberry Pi because it seems so much more advanced in the things it can do. Why they don’t include an ADC on the Pi doesn’t make sense to me, but I plan to use one of the chip based ADC converters you mentioned, such as the ADS1115 I have here.

    1. The problem with that is, these videos would get longer with him having to explain the same things over and over.

  4. Great stuff Mr. Mcwhorter, I liked your data chart. I wonder if the older raspberry pi models had the gpio readall command. I found it by accident by typing in gpio.

LEAVE YOUR COMMENT

Your email address will not be published. Required fields are marked *