Raspberry Pi LESSON 4 : Understanding and Using GPIO Pins

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is paul mcquarter with toptechboy.com and we're here today with episode number four in our incredible new tutorial series where you're gonna teach your raspberry pi who's boss what i'm going to need you to do is pour yourself a nice tall glass of ice cold coffee that would be straight up black coffee poured over ice no sugar no sweeteners none needed and as you're pouring your coffee as always i want to give a shout out to our friends over at sun founder who are sponsoring this series of video lessons and also in the series of lessons we will be using the most excellent sun founder ultimate raspberry pi kit if you guys don't have your kit yet look down in the description there is a link over to amazon where you can pick a kit up now believe me in these lessons your life is going to be easier and my life is going to be easier if we are working on the same set of hardware hopefully most of you guys already have your kit because i told you a few weeks ago that we would be getting to this point and today is the day that you've been waiting for where we're going to crack open our kits and we're going to be looking at all of that juicy component goodness inside of this kit and we're going to build our first circuit and what we are going to do is we are going to actually start working with the gpio pins so so enough of this shameless advertising let's jump in and let's talk about what i am going to teach you today and what i'm going to teach you today is i'm going to teach you how to interact with the gpio pins on the raspberry pi okay so that's going to be several things that i'm going to have to do today there's going to be a lot happening in today's lesson it might be one of those lessons that you need to go back and watch a time or two but i'm going to try to fit it into one lesson first thing is you are going to have to watch me change my view here the first thing that you are going to need to do is on your raspberry pi we're going to have to learn how these pins are numbered there's 40 gpio pins we're going to have to learn the numbering system of what pins do what that's the first thing second thing is i'm going to have to give a very brief refresher on how the breadboards work because i know a lot of you guys are old pros you've taken the arduino lessons you've taken all of my python lessons you understand a breadboard but guys remember there's guys out there that haven't gone through that yet so i'm going to take a few minutes and i'm going to remind them and show them and teach them how the breadboard is configured and how to use the breadboard you guys that are experts already have a little grace and have a little patience because we were all beginners at uh at one point so i'm going to take three or four minutes and explain the breadboard then we're going to look at the schematic that we're going to build today it's going to be a simple led circuit then we're going to go through the build and then i'm going to show you in python how to interact with those gpio pins this is really exciting because you think ah lincoln led that's not such a big deal yeah but what you got to realize is is that if you can turn an led on and off you could turn a motor on and off you could open and close curtains or windows you can kind of do anything once you can work with an l with a with a gpio pin we start with leds because they're low cost and if something goes wrong it doesn't hurt if you run your led and secondly no one has ever been killed using an led so it's safe so i like to do things where people can't hurt themselves you guys want to see my studio is like showing you my studio i'm still keeping it kind of neat there's some junk on the floor there maybe i need to spin it this way a little bit more okay there you can see it so you can see let me get out of your way you can see this is going to be my build area here so if i put my kit here you can see me open it up from the overhead camera and so i'm going to be building here and then you guys will be watching from this camera and then always be the little guy in the corner there so that's kind of how we have it configured but enough of this looking in my studio let's jump in and let's talk about those gpio pins all right first thing i'm going to tell you is the gpio pins on the raspberry pi are not as straightforward as what we had on the arduino on the arduino they were all laid out logically you had your analog pins you had your digital pins they were all labeled the digital plant pins that you could use for analog or pwm they had the squigglies by them tx and rx clearly labeled it's just like was very very clear on the raspberry pi not so much but never fear i am going to take you through it step by step and you're really going to understand some things that could be quite confusing because a lot of times this isn't explained very well okay the first thing that we want to do is i want you to look i want you to orient your raspberry pi like i have mine so your right will be my my right will be your right and your left uh and my left will be the same thing so what i have to the left i have the power in the hdmi cables to the left i've got the usb connections down here at the bottom and the gpio pins are over here at the right what i want you to see is you have two columns of pins two columns of pins total of 40 pins and there are 20 pins in a column you have oriented this way you have the left or inside pins and you have the right or outside pins and the simplest thing to see is is that with the board configuration the board methodology of numbering the pins they are shown that numbering system here in the kind of olive green and what you can see is the upper left pin the upper left pin is pin one and then the upper right pin is pin two go to the next row row two the left pin is three the right pin is four so it goes like one 3 4 5 6 7 8 and you can see the pattern continues so the inside column are all your odd pins and the outside column is all your even pins so odd pins on the inside even pins on the outside so if i want pin 8 i would start on the outside and just count it would count down 2 4 6 8 that would be pin 8 or similarly 1 3 5 nine and so that is how it works now you will see that with the peach background i have something different called bcm there is a different pin numbering scheme and that is called bcm for broadcom and in that case the physical pin 3 the physical pin 3 would be the broadcom pin 2. so you see the broadcom pin numbering system is completely to our look at it like random and if you wanted to use that numbering system you would always have to have the pin out on the wall and check things and it's just very very confusing so why do i even tell you about it so if you run into it in a project later on and the pin numbering doesn't make sense it's probably because they're using the bcm numbering system and not the uh and not the physical pin or board numbering system what i will say is you'll we'll get to this later but like the first thing that you do when you're interacting with the gpio pins you tell it whether you're going to be using the bcm numbering system or the uh or the board numbering system okay sounds like i'm talking a lot about that but i really want you guys to understand it now what i want you to see is all of these pins in these outside columns it shows you what the pins do first of all you can see that physical pin one and physical pin 17 that's a physical pin one here and physical pin 17 are just fixed outputs they're 3.3 volts always on always 3.3 volts then in physical pin 2 in physical pin 2 and 4 you've got fixed 5 volt outputs all right what you can also see in gray is you've got about six grounds you've got 9 25 39 it looks like 34 30 and 14 you have it looks like about six grounds that's great you got a lot of grounds again those are always grounds just like those other ones are always three point three or five so those are not pins you can program those are not gpio pins those are fixed output pins now some pins like let's go to the next one so just the straight out gpio pins that you can go in and you can interact with are those with an aqua background it looks like 17 through 22 and 5 through 26 then similarly on the right you've got a lot of them so it looks like you've got a large number of gpio pins that you can work with now there are a few pins that are dual purpose they could be gpio or they could be special function and an example of that would be pins three and five are your i2c pins or they could be gpio pins what i do is i don't use them as gpio pins i always hold those back in reserve in case i need i2c similarly pins 19 through 23 similarly pins 19 through 23 19 19 21 23 and then 24 and 26 are your spi pins i don't use them as gpio pins i'll reserve them for their special function of spi pins 27 and 28 are reserved for eprom i'm not going to talk a lot about that today but just bottom line for you don't use them for now we'll talk about them more later and finally if you want to do serial communication or uart or txrx okay those are pins six and eight and those are very precious so i don't use those as gpio pins okay talked a lot talk too much what you need to remember is those in aqua are the best ones to use okay the ones in aqua are the best ones to use all right so now what do we want to do what we want to do now is we want to go in and make sure that my purple thing is straight you guys are going to have to just deal with my ocd that i can't stand things being crooked okay there you go that's going to be that's going to be perfect like that so what we need to do now is we need to hook up the circuit for the led okay you guys that are experts already be patient we're gonna take five minutes ten minutes to get the new guys up to speed so no man is left behind or a woman no woman left behind either we're actually having a few more women take these lessons that really makes me happy we've got a demographic of about 99 male on this channel and so it's always great to see you ladies out there taking the class thumbs up to you top tech boy salute to the women who are taking uh taking these lessons okay but i digress i digress let's come over here now and let's talk about the circuit that we are going to build and a little bit about how a breadboard works but maybe yeah let's uh let's do that let's talk about the circuit the circuit schematic is here over my head and what you can see is we have a voltage supply hooked up to a resistor that resistor is 330 ohms and then it's connected to an led and the led goes to ground all right so that is the circuit that we're going to build but the trick is to go from that schematic to having parts that we connect together and that's just something that it seems like my students in the real world always really had trouble going from the abstract schematic to plugging things in on the breadboard so the way that i recommend doing it the way that i recommend doing it is start at the plus of your circuit like the plus voltage supply and imagine you're in a little car and you just drive around the circuit and you see what's connected to what well that voltage is going to come from the it's going to come from the arduino okay we're going to use one of those gpio pins so we would take a wire from the gpio pin which is going to be our plus and it connects to what to one leg of the resistor and then the other leg of the resistor connects to what to the led and then the other leg of the led comes down and connects to ground now how do we do that how do we make those connections we make those connections on a breadboard and this is what you need to know about a breadboard that along a column those little holes along a column are all connected together when you go across a row across a row those holes are not connected together and so if i want the resistor leg to connect to the led leg those two legs need to be in the same what the same column okay so columns are connected rows are not now there is one or there's a couple of special cases and that is if you look in the middle of your breadboard there is a trench running long ways along the middle above that and below that are not connected so all the dots above it in a column are connected all the holes below it in a column are connected but those two columns do not connect as it jumps across the trench the trench breaks the connection that's one thing the the other special thing is the bottom two rows are connected to themselves all the way across so bottom row connected to itself all the way across second to the bottom row connected to itself all the way across and same thing top row connected all the way across second row connected all the way across and i've shown that if you just study this where i've got the annotations you really got to understand that if you understand it building the circuit is going to be really easy okay so how do we go from this schematic to actually building something and what i'll do is i will show you my solution here okay my solution is here all right i'm going to bring the real raspberry pi i'm going to bring the real raspberry pi down below the drawn raspberry pi and first of all we're going to have to figure out where are we going to connect to get that positive and that negative that positive voltage in that ground and so we can come back over here and look at our pin out and we can see the first really convenient ground is pin nine pin nine is the first really convenient ground and then right below it is a general purpose uh in input output gpio is general purpose input output there's just a plain one there below the ground and so we are going to use pins 9 and 11. 9 is ground and 11 is going to be the control voltage and so let's come back over here and so what you can see is we're going to have a wire that's going to go from pin 11 our gpio pin it's going to come over and it's going to hook to the left leg of a resistor which is going to be a 330 ohm resistor the right leg of the resistor is going to connect to the led and then the other leg of the led is going to go back to ground and so this picture is a physical representation of this schematic and being able to go from the schematic to the picture is really really important and you need to stop if you're new and really really understand that okay so we've gone from the schematic to the actual physical layout and then i just made a note on here that pin 9 is ground and pin 11 is going to be our gpio pin what do we need to do now we need to get our kit and crack into it this is the moment we have all been waiting for so we're going to get our kit and we're going to put it here and what you guys need to be really really careful about is keeping this nice and neat okay so we're gonna come down here and you can see that you just pull from the top pull from the top and then we're gonna open it up and wow look at all of that electronic component goodness look at that we've got all types of stuff in here but we're not going to take it apart and look at all the different things we're going to look at the things that we need to first and the first thing we needed was a what a resistor and this is our package of resistors okay and you can see that there's all different values here well what did we want we wanted a 330 ohm resistor so you're going to be looking for the label that says 330. so that's 100 r which would be 100 ohms if there's a k k means thousand so 1k would be 1 000 ohms and look there for me is the 330 ohm resistor so i'm going to open this up and i'm going to pull this out carefully okay and you can see that these are our 330 ohm resistors now what you need to do is get one on the end and you kind of pull it out of that paper tab and then same thing here i hold the tab and i pull it out now i have a resistor and i'll put it over here and now we just throw this off to the side right no we keep our we keep our kit neat there's also some sort of strange quantum mechanics going on here that when we take the components out of the box and then put them back in they get twice as big and so if you take a bunch of stuff out it's really hard to get it back in and get the lid closed and so you've got to do it very very neatly or you'll just really never be able to get the lid closed again and that's one of the things that really bugged me when i had students in the real world with students that didn't keep their uh that didn't keep their kids neat okay now what we're gonna do is get a red led okay very important it needs to be read and the most important thing is you are not to use the blue leds because the blue leds are for special occasions only so maybe we'll have a special project someday in the future for the special occasion led but for this we will use the red okay so now i've got a red led i've got a 330 ohm resistor and what else do i need i need our friend what mr breadboard okay you remember i showed you the picture of this well this is the real one so i've got the breadboard i've got the resistor i've got the led what do i need now what i need now is to take this tray out and i need the two wires now the wires are going to need to be a female end to connect to the raspberry pi and then the other end needs to be male to plug into these holes so i need a female to male now you can see this is a big wonderful bundle a big wonderful bundle of wires that are male to male the cool thing about this kit is you notice that there's a whole lot of wires and then there's different sizes like really long ones mediums and short ones and that's neat because you don't always want to use a long one but sometimes you need the long ones so there's some long ones and medium ones and short ones but these are male to male so this won't work for this project and then you can see there is a ribbon here and this ribbon this one is female on this end female to male and that is what we want and then there's also here a female to female you see that one's female to female you want the female to male okay and now i have to hold these on here and pretend that i didn't already pull the two end ones off but i did a trial run of this so i've already peeled them off but what you can see is they're kind of they're kind of stuck together and what i came out is i came out and i got the brown and the red and then you just kind of peel them away and they'll come loose from the bundle but you want to do it carefully because you want to keep your other bundle together and then when i pulled the two off off i pulled them off together and i kind of like to use red for the voltage supply and i'd like to use black for the ground but the brown is almost black so we'll just pretend this brown one is black so i'm using the red and the brown and i'll use red as the voltage control and i'll use the brown one as the ground okay now we're just going to put this back together neatly i'm going to put everything back in its place and you got to kind of do this where you'll be able to get the lid on now we'll put the tray back in like that and put the tray back in and i kind of need to adjust that a little bit there i think that's going to work and now we will close the lid and there got it all back together neatly now what we need to do i think is come back over here to this view and this shows the circuit up top that we want to build and then this is the real raspberry pi and then here is my circuit board with my components and my wires now the first thing that i want to do is i want to hook these two wires up because that's really the hardest thing is getting the wires in the right place on the raspberry pi board because you got to kind of pay attention and what you can see is we said that pin 9 was the ground and so pin 9 we want the brown wire on pin 9. well how do i do that i know that the upper left is pin one so i kind of just count one three five seven nine and then i plug it in there to the nine pin and then what i know is i know the pin right below that is pin 11. so you see i'm actually doing this i can't see it very well i'd have to get it in front of my face and that wouldn't be very fun to watch but i know the pen right below it is pin 11 and so there i missed it i went to 13 so i'm going to come back and get it right in pin 11. okay so now i've got the ground pin 9 and i've got the gpi open that we're going to use the red for the red wire which is pin 11. i've got that now let's start with the voltage and so i'm going to start with the red wire and you come in and you just put it in one of these columns it doesn't really matter which one what matters is is that whichever one i use like it looks like i'm going to use let's say column 5 there what matters is the led plugs into that same column now what i want you to notice about the led do you notice how one leg is longer than the other that really matters you can't just plug the led in any direction like this way or this way it matters and what you have to do is the long leg the long leg needs to always be going back towards the positive voltage so you see the red wire is the positive voltage and so which leg needs to be in that column the long leg and so the long leg needs to be in the column with the positive voltage okay like that and then the short leg needs to just be wherever it's convenient just a couple of columns over okay so i think what i did was i put the long leg in the same column as the red wire and then like i skipped a column and then the next column i put the short leg of the led now if we look at our schematic and we look at our picture what do we see ah i did not follow it sorry everything i said about the long leg is still true but here i have the resistor in next okay so let's put the resistor in and while i say about the resistor the direction of the resistor doesn't matter but i like to kind of bend kind of my legs straight down like that and straight down like that kind of making that shape and that makes it easier to keep your circuit okay so where does the red wire connect the red wire connects to the left leg of the resistor now for the resistor you could put it in this way or you could put it in this way the direction doesn't matter on the resistor but you just have to make sure that you put it in the same column you put it in the same column as your power supply okay and now the other leg it can go in any column just kind of whichever one it naturally comes to whichever one it naturally reaches and now i've got the resistoring now the right leg of the resistor connects to what the right leg of the resistor connects to the led in which leg of the led the long leg why the long leg because the positive voltage is coming from this direction and the long leg always has to be pointing towards the positive of the circuit and i've got to have this long leg in the same column as that right leg of the resistor and then the short leg can kind of be wherever is convenient you see just over a couple of columns but you just couldn't plug the short leg into that same column or you would be shorting that out you just got to go over a little bit and then finally the short leg of the led connects to what the ground and so we're going to come and bring that ground wire into the same column as the short leg and uh i'm verifying that that is in the same one okay so now we have our circuit hooked up and our purple card is very crooked so we're to have to get everything very straight here everything in the universe in proper order okay so that looks really really good so we've gone from the schematic we've gone from the schematic excuse me we've gone from the schematic to a physical layout and then we've sorry we have built it now in the real world all right so now if we go and now is the time that we would go in and we would actually start working with the gpio pins getting them configured but what i always like to do is let's just say that it didn't work then we wouldn't know was our led bad did we hook it up wrong is one of the components wrong is a wire wrong i want to confirm that this circuit actually works before i go in and start playing with the gpio pins how can i make sure that everything all the hardware at this point works okay what i could do is i could take this red my power pin and i could disconnect it from 11 and i could come up to pin one and plug it into pin one which is 3.3 volts look at that the led comes on that tells me that my circuit and my components are good now if we run into a problem we'll know that the problem is with our coding so now we are coming back to pin 11 and putting it back it's a lot easier if you can pick this up and put it in front of your face but i've got to keep it in your view and so i've got to kind of do it sort of carefully without being able to see it real well okay i think that is right so now i believe we're going to need to come over here to a different view and in this view now i'm going to go ahead and move my circuit up here so you can see so you can see the raspberry pi in real time you can see a live view of the circuit and then you're going to be able to see what i'm coding all right so we're now ready to go in and we are ready to start coding so what i need you to do is you hopefully have your raspberry pi already fired up and what we're going to do is we are going to come over here and what i need you to do is fire up a terminal so you just click on this little terminal icon and then let's see boom there you've got a terminal you come up in linux the dollar sign says it's waiting for a linux command but we're going to control we're going to control the gpio pin through python okay but i'm not going to write a python program and run it we're just going to run in the shell at the command line so we're sending python commands one at a time so you can just sort of kind of keep track of you know keep track of things one line at a time and then you can always come in later and uh and write a you can always come in later and write a uh write a program so let's come in and what we're going to do is go to the python shell and we do that how by just typing in python right wrong wrong why do you just not type in python you guys that took lesson number three if you type in python it goes to python 2.7 which is deprecated we don't want to use that we want to use python python3 so here i'm going to come in and say quit open close that takes me out we want python3 how do we get that by typing python3 and boom this fires up for me python 3.7.3 gives me the three it gives me the three greater than sign saying that it is waiting for a python command well if we're gonna if we're going to work with nothing a little coffee won't fix if we are going to work with the gpio pins we need to load we need to load the gpio library and how do we do that remember import and we import rp uppercase little i for raspberry pi and then gpio all uppercase this is the library now we want to import that as what you can import it as whatever you want but i'm going to import it as gpio uppercase okay if you use something other than gpio then when you call it you've got to call it whatever you called it so like if you imported it as kitty litter then anytime you wanted to address it you would address it as kitty litter but i think it would be more meaningful if we called it gpao like that boom library has been imported so we're ready to talk to the gpio pins well the first thing that we have to do is remember how i was telling you that there are two different numbering schemes there is the board numbering scheme and then there is the bcm numbering scheme what do we want to use we want to use the board numbering scheme so we've got to tell it that and how do we do it how do we do that we call the gpio the gpio in dot what do we do a set mode we tell it what mode we want to be in and the mode that we want to be in is gpio that's what we imported the library as and then what b o a r d like that now if we wanted it to be the bcm numbering we would have put dot bcm boom it like that now just like in arduino just like in arduino you had to do a pin mode you have to tell raspberry pi whether our pin is going to be an input or an output so we're going to do a gpio dot set up where we're going to set up a pin which pin are we using we're using board pin 11 and then what is board pin going to be it's going to be a gpio.out [Music] all uppercase now the gpio here is what we named the library when we bring it in and then the dot out is the method that's being called so you've got to do it just like that okay so this is as good of a time as any to learn this what is wrong i was playing with this beforehand i was playing with this beforehand and when i was playing with it i didn't release the gpio pin so when you are done with the gpio pins you need to do a gpio dot clean up or you end up locking them up and messing things up for the other guy so when you exit your program or when you're done you always have to release things so we're going to do that you probably didn't get that error so you will be okay but now i need to go back and then i need to import this again and then i need to go back and i need to do my set mode again and then i need to go back and i need to do my uh gpio11 and make it an out and you see now it's happy because i cleaned it up all right so embarrassing little rookie mistake there but it's kind of good that i made it because if i did you would make it and then you would know what's uh what's going on and so what you always got to do is when you're done you've got to release those pins with a gpo thing so we told it we're on board we've told it that 11 is an output what are we ready to do we are ready to try to turn that led on and we do that with gpio what do i want to do i want to do a dot output and then what do i want to output to pin 11 and then what i want to do is i want to make it true okay this is where we really hold our breath this is our first gpio command all eyes on the led hold your breath boom look at that who's the magic man i'm the magic man look at that we turn the led on okay well if you can turn the led on how would you turn it off any guesses oh how am i getting that previous command i'm just hitting the up arrow and it takes me back instead of true any guesses false all eyes on the led shazam look at that it turned off okay we can turn the led on we can turn the led off i also just kind of wonder like what if i did a gpio dot output and instead of doing true what if i just said make it a one boom that works and similarly i could make it a zero and i could turn it off okay look at that we're turning it on and off now i also kind of can show you a lot a library that i'm not sure i showed you last week when you're actually programming these gpio pins a lot of times you want to put a delay in your program how do you do a delay in python you say import time like that and then you just do time dot sleep and tell it how many seconds so let's say we want to sleep for three seconds and then we click enter 1001 1002 1003 and boom it's ready for the next command or you could say time dot sleep a decimal like .1 would be a tenth of a second and boom it comes back so that's how you do delays now i really don't like the true false business very much and so what i would probably do is i would come in and i would say on is equal to true true and then i would say off is equal to false and then we could come in and we could do the uh we could do the output and we could output on like that boom it comes off and we could comes on and then we could do output off and it goes off look at that all right guys man this is so exciting to me this is really really really cool stuff now what is it that we should probably go ahead and do now what we should probably go ahead and do is do our gpio dot clean up so we clean up our mess and we leave a clean slate for the new guys whoever comes in and uses this they've got a clean slate now what would maybe be one other just kind of cool thing to try to do here just to make sure that we understand things right this we use the which we use the board set mode what is the other one bcm and the bcm numbering system pin 11 on the board would be what the bcm pin 17. let's see if we can do that just to make sure that we understand things right and so to do that also it's just practice to do this again to do that what would we do we would import rpi dot gpio okay as what gpio like that all right that's happy then i would do a g p i o dot set mode and that would be g p i o dot what b c m like that all right now we're going to do a g p i o dot what dot set up lower case and then we're going to set it up as what g p i o g p i o dot what not board but b c m like that right now hopefully that was a simple error what did i do that sure looks right gpio dot setup oh oh oh oh okay i gotta tell it i gotta tell it which uh i just i just kind of okay set mode oh i did set up i already did that okay set up that was just a terrible mistake the setup is switch pin the setup is pin 17 okay because i already did the gpio dot set mode so the gpio.setup is pin 17 which is the bcm pin for physical pin 11 and then what do i want it as i want it as a gpio dot out i got going too fast and i just glitched on you all right so this then should set bcm pin 17 which is physical pin 11 is an output and uh that took it okay that's good it's happy now and now what i could do is gpio dot output and we're going to output to what 17 which is really pin 11 and we're going to do a what we are going to do a true like that bcm mode turn the led on okay wow all right so now if we turn it on we probably need to go ahead and turn it off so i'll say false boom it's off and now what do we need to do gpio dot clean up like that and boom now we cleaned up our mess the gpio pins are available to whoever uses it next i was going to come in and show you like how important how important like the whole point of the lesson is always clean up your gpio pins when you're done and all that and then what did i do i forgot to do it in this lesson and so that was a pretty bad mistake okay guys man i hope you're having as much fun with this as i am this is just really really neat stuff really really cool stuff and i just get so excited about turning an led on and off because i know that if i can turn that led on and off it's like the world is my oyster i can just turn on anything and turn off anything in control it just it really it it takes you it bridges the gap from something that is very powerful right this this uh art this raspberry pi is very powerful it's almost as powerful as a desktop computer but then it gives you access to the outside world through these gpio pins and that is just so incredible and it's just so powerful and is so valuable and so what we're going to be doing as we go through the rest of these lessons we're going to be coming up with more and more interesting components in the kit and then we're going to be doing more and more complex and more and more sophisticated calculations and computation and so our projects are going to just be getting better and better and better but we've set the the kind of core foundation here and that is from python you can control the gpio pins and so that's going to really allow some really incredible things now i will need to give you guys a homework assignment and what your homework assignment is is to take this circuit and now go in and actually write a python program and i showed you how to do that in lesson number three but you want to edit a program and you want to write a program that number one inputs ask the user for input ask the user how many times he wants to blink the led and then when he answers then come in and blink the led that number of times and then i want it where you don't have to run the program again it'll just come in and then ask him again to uh you know ask him again how many times does he want to blink the led and then blink it for that number of times and that is what your homework assignment is going to be now what you need to do is and guys i know that for a lot of you this is like really really simple i'm going to do the the solution to the homework and these premier lessons are released on thursdays and so if you're watching this as a premiere on thursday i will release the solution to this homework assignment on friday so you can tune in on friday to watch the solution to this homework if you guys are really advanced already you know how to do this you can just tune in next thursday to the next lesson so next thursday will be the next lesson on friday tomorrow for you guys watching the premiere it will be the uh my homework solution to the to the homework that i just got that i just gave you so hopefully uh hopefully that makes sense now when you do the homework you need to take a screen capture of it do a screen recording or you could even just point your phone at your screen and record it and then upload your solution to youtube in the description of your homework solution make sure you link back to this video so anyone watching it will have context so link back to this video then in the comments down below leave a comment with a link over your homework assignment and i watch every single homework assignment every single homework assignment you guys do i watch because i like really sync are you guys learning do you know what you're doing are there people that are really doing things so i watch every single homework assignment okay guys i hope you are having as much fun taking these lessons as i am making them you can see i'm getting really really excited about this class and i can't wait for next week to go to the next lesson if you like this video be sure to give it a thumbs up if you've not already subscribed to the channel subscribe and when you do make sure to ring that bell so you'll get notification when future lessons come out and share this video with other people okay share this series of lessons with other people because the world needs more people that can do engineering and code and fewer people sitting around watching silly cat videos paul mcquarter from toptechboy.com reminding you guys to resist the metaverse resist the metaverse okay i will talk to you guys later [Music]
Info
Channel: Paul McWhorter
Views: 52,285
Rating: undefined out of 5
Keywords:
Id: az90qK3jmDo
Channel Id: undefined
Length: 45min 45sec (2745 seconds)
Published: Thu Mar 31 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.