Raspberry Pi Pico W LESSON 78: Control NeoPixel Array Using an Infrared IR Remote in MicroPython

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Paul mcarter with toptechboy do.com and we're here today with episode number 78 in our incredible new tutorial Series where you're unleashing the power of your Raspberry Pi Pico W what I will 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 sunfounder sunfounder is actually sponsoring this most excellent series of video lessons and in this class we will be using the Kepler kit for Raspberry Pi Pico W now most of you guys already have your gear but if you don't take a look down in the description there is a link over to Amazon and you can hop on over there and pick your kit up and believe me your life and my life are going to be a whole lot simpler if we are working on identical Hardware but enough of this Shameless self-promotion let's jump in and talk about what I am going to teach you today and what I'm going to do is I'm going to show you my solution to the homework assignment that I gave you in lesson number 77 but I must first ask were you able to do the homework if you were able to do the homework leave a comment down below I Am Legend double chest bump and if you were not successful leave a comment down below I folded up like a cheap Walmart lawn chair but never fear I'm going to show you my solution and I'm hoping most of you guys were able to do this because we did four or five lessons on the neopixel so you should understand that and we did four or five lessons on the remote and we have a Dandy little program that allows us to effectively and very simply and intuitively use this remote and so really today we're just bringing it home by combining things that we learned in the past now why do I do homeworks like this because you've got to keep using those tools or you're going to lose them right you either use it or lose it so I want to reinforce the learning from the earlier lessons plus we're moving forward and doing cooler and cooler things now what was the homework assignment what was the homework assignment you ask well it was to connect a neopixel array to your Raspberry Pi Pico W and to control the neopixel array using the little remote in the kit and what the challenge was was to see who could come up with the most Bodacious solution of the most interesting intriguing awesome amazing color demonstrations on the neopixel and selecting what color profile you want to do or what color program you want to show using the remote okay hopefully you guys were successful I'm making this video before you know you've had a chance to watch the last one so I don't know what you guys have come up with but I am really looking forward to seeing the different solutions you came up with I will be writing a program and then that'll serve as the framework and then you could take my program and you could add even more uh you know uh sequences on the uh sequences on the uh on the neopixel based on the framework that I am developing today okay let me get out of your way let me get out of your way here let me have a little sip of my Go Juice very simple circuit that we have set up again we have the infrared remote connected when the when the LED or when the uh receiver is pointed towards you the leftmost pin is the control pin and that control pin we have hooked up to it looks like let me check my notes just to be sure it looks like we have that hooked up to GPI pin 17 in this orientation the middle pin is ground so we come down to our ground Rail and the right pin is power so we come down to our power rail now the ground pin the ground pin that we are using over here to establish the ground rail is let me get out of your way the ground pin is physical pin 38 comes down physical pin 38 comes down and generates the ground Rail and then physical pin 36 generates the 3.3 volts which then comes back over here to the rightmost PIN for power now neopixel is similarly I have the red wire of the neopixel hooked up to physical pin 40 that should be feeding through the 5 volts from the uh USB connector and then uh the ground comes down to the ground Rail and the yellow which is the control wire it is hooked up to it looks like uh GPI pin zero up here in the upper right so the the hookup is really pretty easy okay the hookup is really pretty easy and then what we're going to do is we're going to come over here to our code View and we're going to get ready to write this program now there were a couple of libraries and routines that we did in the earlier programs that is going to make your life a whole lot easier so we're going to come over to the most excellent www.top techboy do.com and we're going to go back to that lesson that we did that was what lesson 75 two lessons ago when we where we created this program that generates a very intuitive way to interact with the infrared so you're going to come to toptech boy.com you're going to use the happy little search bar here to search on something like using an infrared IR remote and then you'll come to this page and you're going to come over here and you're going to click here to copy the code and then you're going to come over here and you are going to paste the code now there's some other code that we'll need but we're going to start with this okay we're going to start with this code and now this let's just make sure this works let's make sure our our remote is working so I'll come here where you can see what I'm doing I'm going to run this code and then to enter a command you hit the power button and then what command do you want well let's just say one two 3 4 five and then to enter whoa what is that no module name machine ah I'm not I'm not hooked up to my Raspberry Pi so I will come here and I will say connect okay I'll get rid of this nonsense okay let's try to run it again okay now what I will do is I will come back to a more normal size and then I'm going to hit power and then I could hit 1 2 3 and EQ is enter so EQ and look at this it gave me my command sequence it knew to start listening at Power and then I entered one 2 3 and I brought it home to complete the command with enter okay so this routine is working working I've got the remote working with the receiver and now I've got to go in and I've start got to start working a little bit with the neopixel so uh again I had a lot of lessons on the neopixel so you should be pretty good at that by now but we need to import neopixel if this doesn't work go back and write my uh go back and watch my earlier one of my first lessons on neopixel you might have to install a library I'm not sure from machine we are we've already imported for machine okay so we don't need to do that again and we have already imported time so really what we needed to import here is we needed to import neopixel okay now let's see if we can set that up and so we're going to come down after all of this business no let's do it up here at the top okay so I have imported my libraries and then I am going to come here and I'm going to say my pix let me put some space in here okay my my pixel pin my neopixel pin was connected to gpio pin zero my pix size how big is my array well mine is is equal to eight LEDs okay and guys this is something pretty neat we're doing and you could use this for a huge neopixel array you've just got to not try to power it from the Raspberry Pi Pico W so if you're going to use a large array you would hit you would connect power to a suitable external DC 5volt power supply and then you would hook ground to ground and then the ground of the power supply external power supply would need to connect to the ground of the Raspberry Pi picw and the ground of the uh IR uh uh sensor so all your grounds have to be hooked together but if you're just doing an 8 pixel you can safely run it from the Raspberry Pi Pico W you can safely power it from the Raspberry Pi Pico W if you're using a great big one you would want to use external power and I just told you how to do that okay so now we've got that but my Pi size is eight which is safe I'm going to go ahead and set up a red color because I'll use that later in my program red is 255 comma 0 comma 0 like that and then my green color is going to be 255 or it's 0 comma 255 comma 0 like that okay I've got that setup now I need to create my pix my neopixel object I'll call it pix and that's equal to Neo pixel. Neo pixel capitalization is important and then I'm going to do the pen of what the method pen of pix pen like that and then I need to tell it how big it is so pix size okay so now I have a PIX object that I can interact with my pix object in order to control the neopixel so that should be pretty good all right now what we're going to need is remember how we wrote that program where we can could convert a angle on the HSV color wheel we could convert that to an RGB value to apply to the neopixel we need to go out and get that little program because I don't want to type this whole thing in again so we're going to come again to the www.top techboy do.com we are going to search on something like convert HSV to RGB will come here and this gives us this nice little function that you pass an angle on the color wheel and it will return to you an R value a GV value and a b value so we're going to get that and then we are going to come back over here and we're just going to put that function in so we've created our neopixel array okay very nicely now we are going to paste that in here okay we're going to paste that in here so now I have a function that I can use and I did it after setting up the neopixel you know what I'm going to do I'm going to get all of my imports at the top so you can see this we got from our original uh IR program so I'm going to copy that and I'm going to go put that up at the top of the code to keep things a little neater okay like that so now I've got the neopixel defined and turned on I've got my function that will convert a degree on the color wheel to an RGB value okay then I come here and now this is that program that we did a couple of weeks ago and that is I create my infrared dictionary that turns the raw number coming off the remote to a more logical descriptor of what button was pressed okay now uh we come down and we get things set up for the infrared okay all that's looking good now this is our infrared callback function explained that in the earlier lesson so that's all good and then I create my IR object all of that is good okay all of that is good but now what we've got to do is we've got to come down to our to our while loop and we've got to make it do something interesting well the first thing the while loop needs to know is do you have a new and complete command from the remote well how would we do that if we look in this call back it is CMD ready right when it sees the power button and a series of key strokes and then it sees the EQ key that is the IR bit 7 then I I make Command ready true now I've got an Open Bracket I've got the power I've got the commands and then I've got the enter okay so we are ready to go well we don't want to do anything down here in our main Loop unless command ready is equal to True okay now what I'm going to do is what I want is I am going the way this program is going to work I'm going to hit power and then I'm going to have different neopixel displays and I'm going to associate those different neopixel displays to like 0 1 2 3 4 5 6 however many you want I'm going to associate those with numbers on the keypad okay so what I'm going to need is right now I've got something like this power 1 2 3 enter well here since I'm just going to run one program it's going to be power and then it's going to be a number and then it's going to be enter and that number is always going to be in position one one power is in position zero and then the program I want to run that number is going to be in position one and so what I want to do is I want to go ahead and get that and I'm going to say the command is going to be equal to new Command right what is new command it's this and I'm not going to get that until command ready equal true but I'm going to make Command new command of position what one like that okay now it told me hey you got a new command I go out and I proc process that new command now what I need to do I need to tell it that command ready is false because the command it sent me I used so I don't have a new command so command ready is false okay does that make sense now let's just go ahead and try that I think we ought to be able to run that so I'm going to come in and I'm going to say power I want to run program one and then equal and then what do I get I get a one and let me go ahead and print command just to show you that that works print CMD okay so let's run this okay so I come in here I press power and then I press program one and then I press enter and look at that now the program knows what is it that the user wants to do he wants to run neopixel sequence or program or whatever one okay does that make sense I hope it does so let's come in and let's start putting in some things here let's just say uh let's just try this okay so I'm going to say if CMD equal equal if CMD equal equal Z what am I going to do if CMD equal equals z what am I going to do well I'm going to go for I in range okay from zero cuz I have element zero up to led8 and you say ah you only have eight LEDs if you go from zero to eight that's that's nine yes but remember how the range works it stops one before eight so this will go 0 to 7 which will be eight hopefully that will make sense to you okay then I'm going to say pick I'm going to say picks of I pix of I is just going to be let's say that that is going to be two let's make it blue 0 comma 0 comma 255 like that okay and then what I would need to do is I've created the array now I need to pick. write and then what I'm going to write I'm going to write this uh I'm going to write this did I do that right this should be pix of I okay so I create the list of colors that I want to send and then what do I do I send it so let's see if this works okay ah CMD isn't defined what is this CMD I said CMD is equal to new command that is very perplexing in line 79 oh okay you see when the first time the program runs it comes into this while loop and what it doesn't know what CMD is because I haven't entered this Loop yet so what do I need need to do way way up here at the top and I'll do it let's see where would it be a good place to do it okay where I'm doing all of these things associated with the uh with the IR so I'm just going to say CMD is equal to uh I'm trying to think I don't want to use a real program name so I'll say CMD is equal to 999 like that so just it has a value so it doesn't error out okay so now now I'm going to go power and I'm going to go one and then I'm going to go enter and I've got power one enter that looks good okay and then what did I do down here I said of command is zero so one doesn't do anything because I haven't defined program one if I do power and then zero and then equal boom look at that it turned it blue okay so that is pretty cool now let's let's uh let's make this let let's turn this off zero is going to turn everything off okay and also what I want to do down here uh if I exit the program cleanly with the keyboard interrupt what do I want to do I want to basically turn everything off and so I'm going to get all this stuff here that I just defined and I'm going to put that I'm going to put that down here contrl V and now I got to get my indentation proper okay get your indentation proper come on okay like that and so this should turn it off on control C so I'm going to run it again okay and you see these stayed on because I didn't do anything in the program to cleanly exit now if I say contrl C boom okay no error it it the program terminated cleanly and it turned everything off when I exited okay now I made zero to turn everything off okay now let's write a program one and what the program one is going to do is it is going to make this you know I Define those variables up here but I'm just going to do it the oldfashioned way so so this is going to be one will turn everything red okay like that and then two is going to turn everything green so I'll make this to 55 and then contrl V if I say uh three if I press three what do I want I want to turn it blue 2 55 like that so let's run this this is kind of fun because we're getting some early successes so I'll say I'll say power one equal I got red Power two enter and that didn't work what went wrong there if command is equal to two it's like it didn't see see it didn't see that let me try again power to enter okay I didn't press the buttons good okay so now I've got green power three enter and I've got blue power Z enter it turns off power two enter it turns green and now I'm going to come back to the keyboard I'm going to contrl C and boom it terminates successfully this is fun why is this fun because because we're getting success very early on we're getting some very early successes okay so I did those three I'm now going to come in I'm going to say if command equal equal 4 well if command equal equal 4 what do I want to do I want to do a running man okay I want to do a let's do a running uh let's do a running blue a running blue against a red background okay so there I'm going to say for I in range and I'm going to go from Pixel one and you'll sort of see why I do that in a minute pixel one 2 pixel 8 and then uh one I think maybe I need to go [Music] from I think I need to go from zero okay I need to go from there's a reason that I go from one because when I'm going backwards I go all the way to that led and so this this will work and I think I talked about this in the uh in the other one what I'm going to go go ahead and do is pick. fill and what do I want to fill it with I want to fill it with red and so this is going to be I don't even think I have to do yeah okay I see what I'm doing doing so I'm going to fill it I'm going to do a pixville red okay so I'm going to do a pixville red and so that's going to be 2 55 comma 0 comma 0 that's going to fill it with red so for every I the first thing that I do is I make everything red and we're going to need a semicolon here okay so if I ask for program 4 it's going to start by making everything red now it won't apply that yet so you won't see everything red and then what do I want to do I want to overwrite that with pi with pix pix of I is going to be equal to Green okay so the very first time it'll be the second one over right zero is the first one the second one is one that's going to be green and you'll see this will work if you just uh if you just stick with me okay so pix of I is equal to I'm going to make it blue okay so that's 0 comma 0 comma 255 like that okay and now I'm going to do a PIX do right so I'm now going to apply that okay and then I'm going to do a Time do sleep of about 0.1 so it doesn't run too fast okay now what should this do it should be all red and then the first one over not the first one but the first one over should be green and it should go to the end and then come back and go to the end all right so now let's do that let's run this okay and this was program 4 so I'm going to come in and say run program for enter and look at that I've got a running blue but you see the blue only comes to here now if you wanted the blue to start at the first we could of course let's let's uh contrl C out gracefully we could start here and instead of starting at one we could start at zero okay and in a One Direction running man I'll do equal four I mean power four equal okay now you see that it comes all the way back here to Blue but you see on the way down I'm going to light that pixel and I don't want to go down and light it and then come back up and light it I only want to light that those end ones one time and that's why instead of starting at zero I'm going to start at one because I don't want it to be doing that I want it to run back and forth so what would I do I would now say uh I would now follow that with 4 I in range okay and this time I'm going to start where I'm going to start at at six okay how come six because six would really be seven okay six would really be seven so the pixel 6 is the seventh one over okay because you start at zero and then I want to I want to go to minus1 which would really go to zero and then I want to go minus one at a time okay so the six will really be seven why don't I want to go all the way to the eighth one because the eighth one I lit I lit up here so I just don't want it to go boom boom boom boom and then boom and boom boom boom boom and boom I don't want to light those end ones twice and you can play around with this and if you run it slower you can see it a little bit better but this will make it run right so I'll go 6 to minus one so on the positive swing uh the first four Loop light the end one and on the backward swing the second for Loop lights the end one and so let's come in here so we're going to say like that and then what am I going to do I'm going to say pix of pix of I pix of I is equal to again I want to go I want to go what do I do here I am writing in the wrong one aren't I okay I should be writing in four okay so this is going from I think I just messed that up let's let's go back I'm sorry I was looking at the wrong code okay so we're running I'm going to say program one I got all red program two I've got all green program three I've got all blue but I didn't change that one because I was writing in the wrong spot so if command is equal to three that needs to be a zero and now it will light them all up okay just I got in the wrong place there I hope it didn't confuse you too much so what I've done here on four I have lit from the zeroth element to the seventh element and what I'm doing is I'm turning them all red and then I turn the one blue so I go from the zero to the 7th okay and now what I'm going to do is I'm going to go backwards for I in range and this time I'm going to start at six and I'm going to go minus one at a time and minus one I'm going to go start at six and go until I get to minus one but it'll stop one before that which is zero okay so that'll be like that and then pick. fill and what do I want to fill it with again I want to fill it with I want to fill it with red and so this is going to be 255 comma 0 comma 0 like that close that close that and now pix of I is going to be equal to Blue which is going to be 0 comma 255 comma 0 0 comma 255 like that okay now I'll do a PIX dot write and then I'll do a time time do sleep like that and I'll sleep by 0.1 okay now let's look at this and see what happens and I'm going to make I'm going to make this 0.5 just so we can make sure that we have that in Behavior working right okay so now this is going to be the power program 4 equal okay so I started at one I come all the way and I go back okay but do you see how it stayed there twice it stayed at that end one twice and so this really needs to be a one okay that needs to be a one let's try this again okay so all red okay I got a star program 4 and then equal okay so that started came over and now it's going to go back okay do you see how it's not dwelling on those Ends by writing them twice one for Loop does one end and the other for Loop does the other and so that is looking really really good and man I wish you could see better how beautifully this is working in real life but that is just absolutely amazing and when you do it yourself you'll see how just absolutely spectacular that is okay so I've got that where I'm doing a running Red Dot but let me show you now let's say see let's see if I can go to a different program so I'm going to go from here and then I'm just going to go straight red and then equal okay now what is the problem here it carried because it finished those two for Loops so let's let's try this if I go from here to two Okay instantly I go to green let's go back to four okay and now uh I think I messed up okay so there's four but now I'm going to go to one and you see I went to one but it's sitting there and it's finishing up okay so you see I want it to be instant I I want it to be Snappy so what do I do here if I get a new command if I get a new command I want to go with it immediately so what I can say is if CMD is not equal to four which is my present program I want to break out of this for Loop so if command changes I want to break out of the for Loop and same thing here if CMD is not equal to 4 what do I want to do I want to break okay now let's see if that is going to work so if command is four I will get in here but then if command changes if CMD changes then I want it to break okay and so now let's try that again so I'm going to go Star 4 equal okay now I'm going to go star one equal okay and it is still going slowly it's still going slowly so the thing is it didn't get a new command because this command it didn't end up back up here so what I think I'm going to have to do is I'm going to have to to go up to my call back function I think I'm going to have to go back to my call back function I'm going to have to go back to my call back function okay and we're going to come up here and then what I'm going to do is I'm going to make CMD I'm going to make that global okay and then when I have this whole thing ready when I have this whole thing ready command ready is true I'm going to go ahead and make Command equal to new command I don't think that will work either okay let's think about this because I really want that to work snappier okay I really want that to work snappier so somehow I have to get down in here and let it know that CMD has changed and I can do that here like that that's going to be new command of what did we say one so let's see if that will update on the Fly that command Okay so let's try this so I'm going to say power program for equal and I pressed the wrong one command or power four equal I get the Running Man and then I'm going to come to one and boom it immediately went there so let's try that again command or power for enter power 0 equal and then immediately it goes out why I'm breaking out down here now if I if I'm doing it that way really all I need to do is here once I get it here it's already going to know what command is because I'm passing it globally and it just need to say okay I have a new command I am processing it so I'm going to make Command ready FSE so let's make sure that works and so I'm going to go power one enter I'm going to go power two enter power three enter power 4 enter power 1 enter okay boom looks really really good so we have our first four programs here that is pretty good and it is working well now let's do the rainbow okay let's do the rainbow and let me make sure my indentation is right yep so we'll put the Rainbow on five if CMD equal equal 5 what am I going to do if CMD is equal equal 5 then what I'm going to do is I'm going to come in here and I am going to make the Rainbow so what am I going to want to do I'm going to want to go from for I in range I want to go from 0° to 360° but it will stop at 359 which is really what you want it to do because 0 and 360 are the same I'll go in increments of one degree and then I'm going to color is going to be equal to get get RGB of I and what is get RGB that is that thing that we did up here that's that function that will return us an r a g and a b okay so I'm going to get RGB okay and then I'm going to fill px. fill with the color that it just returned and I might have to do a little adjustment up here I can't remember if I adjusted this for the values that I need or not up here in this uh I'm probably going to have to adjust this but let's go ahead and run it and see what happens okay so that was five right so I'm going to go power five enter and can't convert float T yeah I've got to I've got to do some adjustments on that part of it and so let's see what would I need to do I need to convert what I'm doing in this Library as it is on the uh on the website this get RGB it is returning it looks like a number between zero and one okay so what I need to do is I need to convert that R I need to make it an integer value of R times 2 55 okay and then because I'm returning a number between 0er and one and the neopixel wants a number between 0 and 255 so this would be n of gtimes 255 and then this would be int of n of btimes 250 5 and then I need to close the my color like that okay and then I return my color so let's see what happens here it's running so I'm just going to try a 0o one enter that looks good zero or power off enter me try it again power off enter it's off now let's try power five enter okay let me try it again power five enter and look at that that is behaving [Music] unexpectedly I think I must have messed something up when I was playing around with this so uh it does this then command ready is false and then what I should probably do here is I should also say new command is equal to open close so I'm going to reset it here so once I get the command I say okay I've processed this now and now what I need to do is I need to make new command empty so let's see if that will work okay so now I'm going to go power one enter power two enter power three enter power five enter okay so it's got the five but it's not making a rainbow so let's come down and look at five okay ah what did I not do what did I not do pix dot right like that okay so now let's try that let's just see if we've got that working power five enter Okay so we've got a rainbow but we better slow it up now right so time do sleep of .1 now let's run it okay Power five enter okay that is looking like a pretty spectacular rainbow but it doesn't seem to really be moving so maybe what I need to do is I need to I need to make that slower it is moving but it is moving too slow okay it's moving but it is moving too slow so we're going to make we're going to speed it up we'll make it 0.01 like that so now let's run it power five equal okay now that is a really beautiful changing rainbow Okay so we've got the rainbow there I'm still I'm still a little confused here if I'm doing this right okay so here if I have a new variable like I'm wondering why I'm even doing any of this because I'm passing it command let's see if I just take this out because what I am doing is when I have a new command when I have a new command meaning that it's seen the enter Then I grab that value and I pass it down I don't even think I need that if statement so let's try this so I'm going to go power and then I'm going to go one okay I've got red Power two enter I've got green power three enter I've got blue Power four enter I've got the running blue Power five enter and then I've got the rainbow okay that is looking good that's working good now let's see if we can turn it off let me try it again power Z enter okay that turned off now I'm going to go power one enter I keep messing up power one equal okay now let's see if I do a contrl c yeah I cleanly exit all right I'm sorry about that confusion everything was working but then I wanted to terminate instantly and in order to terminate instantly down inside of these if statements it always has to know what command is so I had to do that in the call back okay I had to do that in the call back okay so now I have command four and then I have command five and this one I'm also going to need to put a break in here so what I'm going to say is I'm going to say if if CMD is not e not equal to five then what am I going to do I'm going to break out of this okay I'm going to break out of this okay so now let's see I'll try five and then I'll see if I can CLE quickly exit five so there is five going now I'm going to say power one and then boom it it exited really quickly okay let's do one more and then I know you guys are going to get weary with me here here but let's do one more let's do the running rainbow okay let's do the running rainbow and so what I'm going to do is I'm going to say if CMD equal equal 6 so we will make that six okay if it's equal equal six then what I'm going to do is I'm going to go for I in range from 0 to 360 okay in steps of one okay and that is going to be for an individual uh that's going to be for an individual P that's going to be sort of for the overall rainbow but then what I'm going to do is for J in range and then I'm going to go from Pixel 0 28 but it'll stop at seven so that's what I want and then one okay and now the degree is equal to i+ J * 45 and what what is that going to do the first pixel will start at0 the next at 40 at 90 at you see It'll offset each one of the pixels by 45° okay and now I need to remember that this thing might go above 360 because if I is 350 then I + J * 45 is going to be more than 360 and so I have to say that if the degree is greater than or equal to 360 then I need to move it back between 0 and 360 so I will say degree is equal to degree minus 360 like that okay now the color that I'm going to put is going to be equal to get RGB RGB of degrees okay now I'm going to apply that to the individual pixel pixel of what J because it is that inside loop that is stepping through the pixels okay and that is going to be equal to the color that I got back and now I've got to say if CMD is not equal to six then I'm going to break all right now I also so that would break me out of the inside loop but I also need to break out of the outside Loop so if CMD is not equal to 6 I not equal to 6 then I'm going to break right right so this one if I change the command up in the Callback this will break me out of the inside loop it'll go back to the outside Loop and then this will break me out of the outside Loop okay now we don't want to repeat the earlier mistake so I need to make sure that I do a PIX do right like that and then I need to do a time. sleep again about 0.01 seem to be about right and then that looks pretty good so let's run this thing okay now what I'm going to do is I'm going to come in power one enter Red Power two enter I didn't get it power two enter green power three enter blue Power four enter is the running blue okay the running Blue Dot now if I go to Power five equals it quickly terminates and it goes to the rainbow then power six equals and I've got the running rainbow all right guys do you see that that is just really really cool we have got a neat little device here that you could actually run you could again make a really long pixel that you did really super cool things with and then you would just power it from an external power supply but control it from the Raspberry Pi Pico W and that would be really really slick okay now this is your homework assignment for next week we're going to do one more Pro we're going to do one more Project based on this remote and that is there's two things I want you to add let's just see who can come up with the the most spectacular neopixel unit that is controlled by the remote let's see who can do the most I've done six you might want to take off the red green blue and and make it more interesting than that but let's see who can come up with the most interesting one the other thing that I want you to do is I want you to add the little uh the little small uh what is it the 1306 I can't remember what this thing is called but the little the little display I want you to add this display why can't I remember what this is called okay I think it's the something 1306 but uh add this little display where you have it and it could give the user prompts and instructions it could process the command and then it could tell you what program was running okay so you see if you added a little display to this then you're getting really really close to not even needing the computer if you save this under the program main then you could just power this thing up and control it with the remote and not have to use the uh not have to use the the cable right now we're having to use the cable because uh we're powering it from 5 volts and you can't get 5 volts from the battery you would need 5 volts from a power supply but we can get a lot closer there if we go ahead and we add the uh the little display to it okay so that is your homework assignment okay guys I hope this one was not too tedious for you but I had a lot of fun I had a lot of fun playing with this and I made a few mistakes along the way because once I decided to try to break inside the program I had to have real time understanding of what CMD was and that required me to go in and change that call back function okay and so that set me back a little bit but we did get a working program and I hope you are enjoying taking these lessons as much as I am making them always a big thank you to you guys who are supporting me on patreon you're the guys that are keeping me in the game you can also help me by giving me a thumbs up and leaving a comment down below that will always boost my YouTube juice uh if you haven't already subscrib to the channel when you do make sure you ring that Bell so you'll get notifications on future lessons being dropped and as always share this video video with other people cuz the world needs more people doing engineering and fewer people sitting around watching silly cat videos Paul mcarter with toptechboy do.com I will talk to you guys later
Info
Channel: Paul McWhorter
Views: 333
Rating: undefined out of 5
Keywords: STEM, LiveStream, TopTechBoy
Id: Lz7MMT5TGoI
Channel Id: undefined
Length: 54min 13sec (3253 seconds)
Published: Tue Jul 16 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.