Using the Arduino Uno R4 WiFi Built In LED Matrix.

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello guys this is Paul mcarter with toptechboy decom and we are here today live live live and we've got a really exciting program for you today so I will need you to 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 also today I will be enjoying my breakfast which is a creamy cappuccino what this is It's a half a cup of heavy cream I steam it and then I put two shots of espresso in it you have this for breakfast you'll be good to go all day long one of these days I'll have to show you how to do this okay guys let's uh give a shout out to you guys that are in the chat please uh please give me a shout out here and I'll say hello to you Andrew is here Stephen welcome Bryan Dr Dave is here right on time good deal gun Doggy Dog hey gun Doggy Dog welcome Walter cendy uh welcome to all you guys and the ones that I've been talking to Larry and Larry a whoi Beno Aether guy uh Walter USA RPA welcome sorry if I'm not saying your name right but these things are coming by pretty fast and so I'm doing the best I can hey Ed Cox from Texas where are you from Texas ah hail from The Lone Star State as well okay guys yeah I should do a program one day on how I make my various delicious coffee beverages I'll do that one of these days okay what is today's live stream about I'm going to be showing you how to use the LED Matrix on the new Arduino R4 Wi-Fi now I've made some lessons on this but you know in my regular class you know that in my regular class we are going through things very methodically and we start at the absolute uh beginner level because we don't want to leave anyone behind but we do build ups to some very uh very advanced classes now I've made several videos on how to use the LED Matrix on the R4 but those lessons don't drop till August and so kind of the problem I have in making the class I don't want to leave anybody behind but you more advanced guys you're ready to jump in and do some of the cooler stuff so what I thought I might do is I'll continue to do the methodical classes but periodically I will have a live stream where we just jump ahead and show you some of the cool things you can do with the R4 let me know if that sounds like a good strategy let me get some feedback from you guys hey uh PG dog 68 uh Dennis uh uh e ether Ed Cox okay uh oh Hill Country 75 miles north of Austin Hill Country is one of the most beautiful places on Earth so you are Most Blessed to to have such a lovely Abode uh Hey Dr Dave got his uh his Arduino Dr Dave do you have it up and ready to fire it up because I'm going to actually be coding today all right you guys be patient with me because sometimes when I'm making the classes I just get really hung up and can't find an error or get tripped up on something but then I just can edit that part out but today we're going live and so we I hope I can I hope I can really program live but but we will see so what I need you guys to do is I need you to go ahead and get your I need to get out of your way you need to get your Arduino R4 Wii and you need to get it fired up and you need to start with the most excellent excuse me uh I've got a little allergy today I have a neighbor that makes charcoal and there's just and it takes three or four days to make charcoal and you just have this cloud of smoke that kind of comes my direction and it does choke me up a little bit but one of the charms of living in East Africa okay so we're over here and we have the void setup we have the void Loop we are on the uh bare minimum and so I'll give you guys a second to uh I'll give you guys a second to go ahead and get your uh uh go go ahead and get your Arduino plugged in and get your uh IDE fired up all right let me say a little bit about the uh LED Matrix one thing you see is I put a little myar film over mine and that just allows it to show up a little better on the camera it's really brilliant when you turn it on in real life but the camera has trouble picking up the red LEDs and I think think it was Lori that I saw was putting a uh myar film over her LEDs and was getting a lot better uh a lot better uh uh you know picture on the camera so I tried it and that's why you see a little bit of shiny there the challenge is is that you get a little bit of Reflection from the studio lights and then as I Ah that's we're going to call that good enough there okay now what I will say about the Matrix is as I played around with it I found that it was very buggy okay and there's some things that just don't work so of all the things that you should be able to do with it right now one of the libraries doesn't work well with it so what I'm going to show you is I'm going to show you the stuff that works and then later on we're going to hope that they get those bugs worked out and then we can come back and do even more exciting stuff with it but what we can do now is pretty cool okay I'm going to come in and guys I'm not going to be able to code live and monitor the chat so I'm going to do the coding you guys can chat amongst yourselves and then what you can do is is that after I run the program and get it working then I can do a Q&A and interact with you guys because why I love the live stream is I love interacting with you guys well we're going to need to load the library and so we're going to start with a pound include what are we going to include we are going to include Arduino Arduino spelling is important underscore lcore matrix. like that so that loads the LED library and then we're going to create our Matrix object and we do that with Arduino LED Matrix and that I'm going to call my Matrix I'm going to call mine Matrix now you can call yours whatever you want but we're creating that Matrix object so I'm going to call mine Matrix now just a reminder you do not put a semicolon you do not put a semicolon uh when you do a library include but just about everything else is going to need a uh is going to need a uh a semicolon now let's go ahead I just want to make sure that I can load that library and so I'm going to run this thing just to make sure that it's there and if it's not then we're going to be in trouble this isn't doing anything but it just creates the object and it looks like that worked okay now we're going to go ahead and set up our B rate so I'm going to say BR I'm going to say inbr for bod rate is equal to 115200 now back in the original series of Arduino lessons we would use 9600 but it seems like the USB technology has advanced to the point that it will reliably run at 115200 and that just goes a little faster on things where you're interacting through the serial monitor we're going to need a delay in here probably so I'm going to put a DT is equal to 10 uh and that is millisecond so that just puts a little delays between the updates okay now the first method that I'm going to show you is the simplest way to interact with the LEDs now it's a very raw way you're operating at a very very low pixel by pixel level okay you're operating at a very low pixel by pixel level but with this method if you're patient you can create whatever pattern on the LED Matrix that you want now so far we have talked about different variable types we've talked about ins we've talked about floats and we've talked about strings but for interacting with the Matrix you just want to do zeros and ones and so there's a new variable type which is a bite okay now the variable name that I am going to give this is frame because I think of this as like a picture it's like a picture frame and what is it it's a twodimensional array frame is a twodimensional array or a matrix and so when I create the bite array I've got to tell it how big it is well what I have to tell you is is that you always think in terms of rows and columns rows and columns so the first number is how many rows and the second number is how many columns now the reason this can create confusion and you got to keep it straight in your head in matrices it's always the row is first and then the column well what is row row is like Y and what is column column is like X now when we're doing math functions you always want to do X comma y but when you're doing matrices it is really more like y comma X it's it's it's it's row by column and so sometimes when you're calling libraries it's very easy to use the wrong order so you've got to be very deliberate well this is a matrix operation so it is going to be rows how many rows do we have on The Matrix well if you count it it is one two three four five six seven eight so we have eight rows now we've got to tell it how many columns we're going to have in this data structure and if you count across you will see that there are 12 columns now what we have to keep in mind is unlike normal people programmers start counting at zero so the first row is what row zero the last row is what row s now we tell it that there are eight rows and 12 columns but when we index those we need to remember that we start at zero and we go to seven or we go start at zero and go to 11 now I have to create that array so I'm going to say equal and what I what do I do I put an open curly and that opens the Matrix the Clos curly closes the Matrix but I'm going to go ahead and put the close down here all right now what I have to do is I have to fill in the numbers since it's a bite all the numbers are going to be what they are going to be a zero or they are going to be a one okay only zero only one and so now we've got to create this so what have I done so far I have opened the what I have opened the Matrix now I need to what I need to open the first row okay so I've opened the Matrix I've open the first row I've closed the first row cuz you see the Clos curly and then I've closed the Matrix well what is the first row well let's put in 0 comma 0 2 3 4 5 6 7 8 so this is I want to check this carefully 1 2 3 4 5 6 7 8 I'm also so that I don't forget I'm going to go ahead and this ends this command and so I'm going to put the semicolon there just so I don't forget but this is this is really really important because you've got to get it right so I'm going to check again 1 2 3 4 five 6 7 8 so this is column one this this whole thing is Row one and then this is column one column zero column 2 column 3 column four column 5 column 6 column 7 column 8 now no notice when you get to the end of the row there's no more numbers on that row so you don't put a comma there hope that makes sense but now we're going to go to the second row so I need to put a comma so first row is complete now what are we going to do we're going to go to the second row now just to make things easier I'm going to copy this code contrl C and now I'm going to do the second row so now I have row I have two rows I have row zero and I have Row one okay now this is going to be 3 4 5 6 7 8 like that now this is row zero Row one row two Row three row four row five row six row seven that works but now since that is the last row we don't put a comma there we don't put a comma there now because we have not done we haven't done matrices yet in Arduino I want you to really understand this data structure this does what it opens the Matrix this does what it opens the first row we close the first row we give it a comma we give it a comma that was terrible okay we give it a comma to get ready for the next row then this is the next row and it goes all the way down in that P pattern but then we have to see when we close the last row then we just come down and we close the column okay now what I want to do here is I want to go ahead and run this just to see if there's an error in that data structure so I kind of want to check my code as I go because coding coding live is not easy coding live is not easy so hopefully you guys will be patient with me now we're going to come down to the void setup hopefully we'll come down to the void setup okay give ourselves a little room there and we're going to want to go ahead and we are going to want to serial. begin begin because we're probably before this is over going to need to do some debugging and might need to print things so serial. BR that looks good now we have created The Matrix object now we have to turn it on we have to activate it and we do that with matrix. begin open close and our friend Mr semicolon okay Gregory I don't hold my breath anymore because IDE 2.2.1 is so slow to compile I turn blue when I try to hold my breath so we're just going to have to we're just going to have to hope for the best by doing this without holding our breath so let's run it and make sure we haven't put any mistakes in here okay now you see that we don't have anything turning on why do we not have anything turning on we don't have anything turning on because we've created the data structure but we haven't written it to the Matrix but if you look at this what would you expect if we wrote this Frame what would you expect if we wrote this Frame to The Matrix you would expect to see nothing because we put in all zeros we put in all zeros so that means all of the LEDs would be off but what I want you to see is this would be this would be row let's look at it this would be row zero Row one and it would be column zero column one column two and if I made that a one then that particular LED would turn on Okay so we've got all of that done and so now we have done the serial begin and the Matrix begin let's come down to the void Loop and since I tend to forget this I'm going to go ahead and put in the delay of who DT like that all right like that now how do I actually write frame to my object Matrix it is Matrix matrix. render bit map and what am I going to send to the Matrix I'm going to send it my frame and I have to remind it how big is the Matrix that I'm working with and how big is the data structure that I am sending in this one it is rows which would be what it is eight rows and then columns how many columns 12 like that okay and then we'll put in the semicolon all right let's go ahead and the moment of truth let's see if this thing will run it's looking ah what is that what is that what ah who did we forget who did we forget our friend Mr semicolon Man by the time i' I've done 30 lessons on the Arduino R4 Wi-Fi and I'm fixing to have to switch back to micr python for the uh Pi Pico classes and man I'm just gonna right when I get in the habit of always putting the semicolon I'm going to go back to micropython and it's going to take me another two months to stop putting semicolons where they don't belong let's go ahead and let's try this okay it's running all eyes on the LED Matrix and boom what happened absolutely nothing why because we put all zeros well what what if we wanted to come here this is Row one column 0 1 2 3 and let's make that a one all right so we're going to run that all eyes on The Matrix let's see if we can do that come over here it is downloading and boom look at that so what row are we on row zero and then Row one and then column 0o column 1 column 2 column 3 and we have that on now on the camera it looks like that's flickering but that's just uh that's just an artifact of the camera when I'm looking at it with my eye I am not seeing any flickering and so that's uh like the camera not in sync with the LED right okay but boom look at this we're just a few minutes into this thing and we already we already are doing this and now hopefully most of you guys would see that what we've done here now is we can put anything that we want on that Matrix just by manipulating just by manipulating this uh this data structure here let's set this back to zero so somebody tell me if I wanted the four corners of the Matrix turned on how would I turn on the four corners of the Matrix somebody tell me uh Andrew yeah Boolean well buy it is kind of like a Boolean yeah it's very similar we have liftoff hey Brian already has his uh Brian already has his working uh I'm surprised there were no compiler warnings putting an 8 by8 uh an 8 by8 frame into an 8 X12 Matrix this is not an 8 by8 frame this is 1 2 3 4 five 6 7 ah Brian you're right I need oh man Brian you caught that that I made a mistake so I'm going to I'm going to take all of this out I told you it was hard to code live okay so now I forgot that this I'm going across column so I have 1 2 3 4 five 6 7 8 9 10 11 12 so let's count 1 2 3 4 5 6 7 8 9 10 11 12 now what did did I tell you I told you that it's easy to confuse the order and that's exactly what I did I forgot that I needed 12 columns and that the rows are going down so let's copy this and then how many of these do we need we need eight which would be seven more so let's correct that so this is going to be that's one 2 3 4 5 6 7 8 so this is row zero Row one row two row Row three row four row five row six row seven okay and now what do what do we remember we don't want that last trailing comma like that now let's try it again and let me just uh let me just go in now now how would we make the corners how would we make the corners turn on I would turn this one on I would turn this one on and I would turn this one on and I would turn this one on but if we look over here it stays the same why did it not change why did it not change somebody tell me why you can't change okay uh can't find the file so I can't include it ether are you saying that uh are you saying that it's not including uh ether are you saying that if you put this command in it doesn't work I think this I think this Library should already be part of when you set the board up so hopefully uh ah oh guys I'm so sorry I didn't switch back over there thank you for telling me let's come back to our code view okay so this is what I did I'm I apologize for that but you can see is this was I had just gone over eight but you need to go all the way over to 12 so this is 1 2 2 3 4 5 6 7 8 9 10 11 12 and then that has 12 elements 12 columns and it has eight rows so I uh I apologize for that again you know doing this live is a little hard because I'm having to manage the studio the live stream the comments and the code and so I apologize that I was on the wrong uh I apologize that I was on the the wrong view there in the studio okay uh guys does this make sense ether still tell me uh I don't have the H file I'm working on trying to uh did you run the program and did you get an error you if you if you just include it and run it it should find it even though it doesn't show up in your library okay hey Brian's already got it working uh okay uh yeah kitty litter box I think Andrew did a whole video Once where he cre called one of his objects kitty litter box and so that the the code worked kitty litter box was not very descriptive but it did work okay let's run this now and see if we get the Four Corners turning on so we're going to come here and all eyes on The Matrix I'm not going to switch back to that full screen view because uh I'll forget to go back okay 1 two 3 four boom so do you guys see how simple this is do you see how simple it is it is pretty darn simple so excuse me whatever you want to do you just come in and uh alter The Matrix but what you can also do is you can alter The Matrix you can alter The Matrix as you go okay so let's come here what I'm going to need to do is I'm going to need an index for the rows and I'm going to need an index for the columns and so let's come in and up here let's create a new variable int and it's going to be I'll call it my I'll call it my row okay and then I'm going to set that how many rows do I have I have eight rows so my row is eight and then I'm going to have int uh now these are indexes these are indexes and so we'll step through it and my row will be the index in the for Loop so I don't give it a value if I have my row I'm also going to need what my call call call like that all right so now I have those variables set up my row and my column now what if I wanted to go in and turn every pixel on well what I could do is I could say four and then I've shown you how to do four Loops for col for my column uh for my column and I want to start at which column column zero and then I want to loop as long as my column is less than or equal to 11 so this will step through 0 1 2 3 4 5 6 7 8 9 10 11 and then it will drop out of the for Loop and then what do I also have to do I have to say my column is equal to my [Music] column + one and what did I do wrong these should be semicolons in here and that's a mistake I make a lot because in a lot of times in something like this in other languages you would use a comma so now I need to open the for Loop and then it closes it so anything that I put in here this is closing the for Loop anything that I put in here what is it going to do anything that I put in here is going to execute in the for Loop now I want to test this so I'm going to go ahead colum I set I'm going to go ahead and set my row equal to zero just so it has a value now when I put the row for Loop in it'll be updating it but I just want to check my code so what am I going to do I'm going to say frame frame of what I'm stepping frame of what I'm GNA alter that data array up there so what am I going to say the frame of my row right because it's row column so frame of my row which is zero and then what my column and I'm going to make that equal to one so I'm going to go and I'm going to fill what I'm Gonna Fill that first row row zero in every column and row zero is going to be turned into a one does that make sense so you guys tell me in the comments when we run this what are you going to expect to see happen on the uh tell me what you're going to expect to see happen on the Matrix okay I'll give you a second but give me a comment what's going to happen when we run this well probably a lot of ugly orange uh complaints but we'll see waiting waiting waiting my row hasn't been defined my row was defined up here wasn't it okay Brian it's been defined up there yeah Andrew you can play with the timing and you can kind of get different things uh different things it seems like no one is answering my question maybe there's a little bit of a delay first row will be filled with one yeah so I would say it as the first row of LED should turn on uh okay so let's come in and let's uh oh man I'm sorry this is in the wrong place isn't it so what I'm going to do is this I'm going to cut somebody saw that we want it down in the loop okay uh and so this needs to go out too I put the for Loop in the setup but where the for Loop should go is it should go down in the like that okay and then I need to close it all right so I have the for Loop in the void Loop and then I open the for Loop and I close the for Loop so it's going to change it's going to change the data structure and then it's going to update the Matrix all at once okay let's see uh yeah but uh okay done compiling all eyes on the LED boom okay now we got the first row but what we still have those bottom ones we still have those bottom ones on because of this so we better go back and we better make this a zero and we better make this a zero now we're going to come in and we're going to change the first row okay we're going to change the first row which is row zero boom okay now did you see how it updated all the LEDs at the same time because what did I do I updated the data structure and then outside of the for loop I sent the data structure all at once I sent the data structure all at once so what could I do here well I could come in and I could put these inside of the four Loop okay so I'm going to cut this and I'm going to put that inside of the for Loop and what's it going to do this time it's going to change the data structure and render it change the data structure and render it change the data structure and render it now because my delay is 10 milliseconds it's probably going to look the same so let's come in and let's make the delay time 100 and then we should be able to perceive those pixels turning on one at a time does that makees sense I hope it does let's look let's look up here this time I'll be sure to switch back this time it's compiling look at that all right now why did the first one come on in the upper corner here why because I'd set the data structure here so I need to set that zero and I need to set that zero and let's make this 250 so we can see it a little bit clearer and let's go with it h you didn't see that did you I promised I would switch it back but what I did was I changed the delay time to 250 all right so that's what I did okay let me press the button and I'll it should run again you see how I'm turning the pixels on one at a time now well what did I do I stepped through the first row well what could I also do I could step through the entire matrix by putting a nested for Loop another for Loop inside of this for Loop so what I do is I've already stepped through the columns now I want to what I want to step through the rows so I'll say four my row equals Zer and then until my as long as my row is less than or equal to what eight and now I'm going to open that for Loop but I want this for Loop inside of the other one so I want to close it you see I take that close off and I want to close it all the way down here all right so now let's see let's look at this this closes the inside for Loop this closes the outside for Loop and this closes the void Loop so if I'm thinking about this right this should just go through and it should update the Matrix pixel by pixel pixel by pixels ah man you guys I am not going to go back to that view so this this is what I did this is what I did let's look here so you see this was our old for Loop and the code that I added was this for Loop inside the other for Loop okay this for Loop is inside the other for Loop so what do we have this closes the inside nested for Loop this closes the outside for Loop and this closes the void Loop so you always got to keep track of these curries and make sure that they balance and make sure that you're ending things at the right time now in uh yeah share screen thank you Brian I'm not going to go back to that other view because it's just one more thing than what I can do a good job at but uh but you've got to really make sure that these are balancing now in python or mic python you keep track of nesting with indentation and that makes the code kind of nice but really I sort of like the uh curries better but you've just got to you've got to be very deliberate in keeping track of where you're opening things and where you're uh closing things okay so you guys see the code now uh yeah I I look over at the chat every once in a while but I see that two times I've I've had the wrong shot going so let's go ahead and let's run this now all eyes here oh what a I do wrong uh that's opened that's opened that's cool this inside for Loop oh oh oh oh what did I forget here we need to go colon my row is equal to my row + one okay I'll give you guys a chance to look at this code this all of this all of this is inside the nested for Loop and then this whole for Loop that begins here and ends here is inside of this for Loop and then this closes the void Loop okay so let's take a look here all right I'm going to live dangerously and put it over here it's compiling ah okay what did I do H it's going column by column okay it is going column by column why because on the inside on the inside loop I'm what I'm changing the row so I change row row row row row row and then I go to the outside for Loop increment the column and come down the rows again like that okay that's pretty cool well what I think we could probably do is we could probably take all of this code we could copy it and then we could put it it would need to go outside that outside for Loop so this is completely starting again and we're going to go through it again but this time we are going to set the frame to what ah man I promise I won't do that again okay so what did I do let me let me just go back and show you what I did again okay so what I did is this is what we have so far okay that is what we have so far and then we have close the inside loop close the close the outside Loop and then close the void Loop so this closes the outside Loop so what I want to do is I want to take all of those Loops down to closing the inside loop closing the outside Loop and I want to copy it and then after I finish going all the way through it I want to go through it again okay but this time what am I going to do I'm going to set it to a zero like that okay so that should what that should step through it again but it should turn it off here we go I apologize you guys be patient this is hard to code live because I've got the additional Studio to try to to manage in the live stream as I am coding okay look at that it's coming down down down down so it's turning on it's turning on that's going pretty well looking good looking good now the real question is what's going to happen when it gets to the end okay why is it not going through and turning off [Music] this is a mystery why I was not able to turn these things off oh I see I had an extra one you guys didn't have this but I'd already pasted okay let me try this again what I'd done is when you were not watching I'd already pasted and then when I switched you back over then I pasted again and so your your guys I think it should be working okay there it goes I had code that you didn't have in there and I'll go back to the code and show you everything that I did is this working for you guys here we go I think it's going to work this time I'll go back through the code kind of Step by Step since I had some missteps in there now boom okay now it's going to go through and turn off and then it'll be at the end of the Void Loop and it should go back and it should do the whole thing again while that is going okay who uh Brian has it working Larry has it working benau has it uh working uh all right man guys I uh I apologize that I've had a few missteps here but you guys be patient with me and after this works a couple of times what we're going to do is we're going to go in and look at the code is anybody having any trouble with this or is it working for for people yeah okay that is working so let's go back and let's look at the code again so what do we do we start the void Loop and then we have two for loops and those two for Loops are nested and then they turn on Pixel by pixel okay then I have those same two for Loops again but this time I turn each pixel off now what if I wanted to update by rows well if I wanted to update by rows I would make the first for loop I would make the first for loop I think I could do that probably if I just came here and I cut that I cut that and then I put it up here so that I step through the columns on the inside and then increment the row so you see I just changed the order of the those two four statements let's see if that [Music] works yeah Andrew that would be a cool project that would be pretty straightforward to do as well it's not doing what I thought for row it's still doing it the strange way so oh I've got to I've got to change it in both places right I had I had two so I've got to change it in both places so the okay so I'm going to on the outside increment through the row and then on the inside increment through the column on the outside I'm I'm going to increment through the row and on the inside I'm going to increment through the column and so let's try this you see the column part was working this part the turning off part was working right because I had switched those two for statements but this time the whole thing should work that's looking good looking good I'm going to live dangerously and switch back over here okay boom you see I'm updating row by row by row and it should turn them off row by row by row okay guys let me get back up let's have a little Q&A here you guys give me some feedback did this work for you are you having problems ether did you ever get your library to load give me some feedback some Q&A and then I'll show you one more thing that you can do on the uh you you can do on The Matrix so with this you can really kind of do whatever you want right with this you could do any pattern that you wanted on that Matrix you've just got to kind of do all the the bookkeeping yourself you know a library doesn't give you a draw Circle command or something like that you've got to keep track of the positions but you should be able to put anything on the Matrix that you want now okay guys let's have a little interaction let's have a little uh let's have a little Q&A uh Ken says he hasn't written the code yet uh ether says his board in is is installed still troubleshooting okay ether I still don't know for sure is it crashing when you try to run it is it just saying uh that that Library isn't found uh yeah flipping did exactly what what we wanted it to there seems to be a delay uh between running uh the turn on versus turning it off any idea why I am not sure about that yeah there does there does seem to be a delay in there and uh I not sure why there's that delay I would have to spend a little bit more time looking at this to understand why it has a delay because I really wouldn't expect that works fla flawlessly Gregory great uh why won't the sketch load only get include the H Library include Arduino LED Matrix h i did the include in quotes you might try that I did the include in quotes you might try that uh Library not found all right if you guys make sure that you're doing it just like this and I'll go in and I'll see if if you've installed the board and you've installed things you really you really should have this uh okay uh let's see Dr Dave is just taking notes now that is fine too okay guys any uh any other questions before I move on to the other thing that we can do with this you guys give me a few questions and then we will move on okay I think the delay is because you have Myro set to a less than or equal to eight I think you are right yes we have found an error that what did I do I forgot to start counting at zero so that would be seven and uh this 812 that is correct and then this eight should be seven who found that who found that that's a that's a good job uh Ron congratulations I'll give you a I'll give you a shout out there for finding my error uh yeah because Brian you probably did it right okay cendy thanks for joining us let's run it again and let's see I am going to uh this was the error this was the error that I had set the road to go from0 to 8 where it should have been 0 to 7 and then here I set it 0 to8 where it should have been 0 to 7 if you do that you won't get a delay so let's go ahead and run that and see what happens [Music] okay what I'm going to do to is I'm going to speed this thing up so let's come back over here that's kind of going slow let's put it back at 100 just so this thing will start running faster and then I'll run it again and we'll take a look at it over here Larry we don't really have sub routines but we have functions and you could Define functions that would make this a lot easier okay look at that boom it's going a lot faster this time now we shouldn't see a delay this time okay yeah that's looking good all right boom okay let's see can you uh I also yeah it I wanted to go slow the first time so you could see it but then it gets a little tedious so we've made it uh We've made it uh work compiles without error but nothing happens Ken did you get the corners to turn on did you get the basics to turn turn on and if you did then probably you just have an error here in your for Loops okay all right not seeing a lot of new questions coming in and so what we're going to do is we're going to kind of go to a new program and so what I'm going to do is I'm going to leave uh I'm going to leave these top two lines and I'm going to leave this but uh this time I'm not going to define the frame okay I'm not going to find the frame so I'm going to take all of this out okay going to take all of that out I don't think I need to Define row and column I do need to start these things and then all of this stuff we did here I'm going to take out okay so I've kind of just got it almost back to bare minimum okay ether uh okay I'm not sure what's going on ether with yours I'm sorry uh I just use delay because for starters for new new guys it's a little bit easier we'll get into delay and using the timers and stuff a little bit later hey nessam welcome glad to have you all right so uh this this seems to be working so now what we're going to need to do is we are going to need to load another library but this Library is not included in the IDE so we're going to have to install it so you're going to come here to the little library and then what you're going to search on is Arduino Graphics like that okay Arduino graphics and here it is okay mine was already there so I'm going to uninstall it so I can show you how to install it so what I'm doing is I'm using version 1.1.0 and if you guys watch this live stream later and there's an updated version go back and use this one 1.1.0 and I'm going to install it okay ether tell me how you get it working when you figure it out hey Shaga I love you too thanks appreciate the kind words uh I hear it stops the program though uh okay Mark I haven't gotten exactly what you were talking about uh yeah there's all types of things that you can use with this disc display especially with what I'm going to show you now so we've got that new library installed okay we've got that new library installed now we need to include it and I believe that it has to be included before the Arduino LED Matrix we still need the Arduino LED Matrix but I'm going to come up here and I'm going to do a pound include and then what am I going to include Arduino graphic fix. like that okay let's just make sure that we can load that Library without getting an error hey Lucius uh Hey welcome glad glad you're taking the class okay Ken I'm not sure what's going on there okay Millies is great for pseudo multitasking yeah there the Millies is a more advanced technique and we'll do that okay it compiled without an error and so that's good then we're going to come down to the void setup that stuff stays the same but what I'm also going to need to do is Let's Make a text message okay I'm going to make a text message and the message should be a string like that and that a string it's a string okay and the string variable is going to be message okay and what's the message equal to it's equal to welcome to top text boy.com like that now we're going to see if we can get that on the screen and guys I should say something about this Graphics Library this Graphics library is designed to run any LED Matrix so it's a library that's been out there for a long time and whatever Matrix you plugged into the Arduino then it has all these cool functions you can do like drawing lines and doing text and you know shapes and circles and ellipses and all that sort of stuff it's a great library but it's buggy and it doesn't work on the R4 Uno at this point but there are a few parts of it that work and the few parts of it that work really are very cool so I'm going to show you the stuff that works but if you go in and try to use all the other methods in this Library they don't work on the R4 and one of the things about this library with the R4 Matrix is you can't write to row Z if you try to write to row zero it crashes so we've got to always start at Row one you know we got to start at Row one not at row zero or you'll crash it so hopefully they'll get those bugs worked out but what we've done is we've loaded it now we're going to come down to the void Loop and in the void loop I got to tell Matrix that I want it to begin a draw so I'm going to tell it I'm going to draw something now what I've got to do is not forget my S my colon okay and now what I am going to do is I've got to give it a font and so I've got to tell it my matrix. text font and what it is is it's font F NT underscore 5 by7 now your choices are 5 by7 which sort of makes the height the full height of the Matrix or a 4x6 which makes it a little bit smaller but since we don't have very many pixels you've really got to do 5 by seven for it to be uh readable now I've got to tell it that I am going to Matrix I'm going to begin text like that now these are some interesting things what column this time it is column by row this time it's X comma y because this is a function and we're back to programming in math where you know programming where we're going to go we're going to go X comma y so what column do I want to start in I want to start in column zero now I would like to start in row zero but I can't because I can't write row zero so I have to start at Row one so this is going to start the text at column Z and Row one if that makes sense now I've got to tell it the color the LEDs here don't take colors but you got to put something in so I'm going to say the red is 255 which is full on and then it is zero uh for the green and it is zero for the blue now one of the things I was disappointed in I was hoping that if I made 255 lower it would sort of control the brightness of the LED but I was not able to get that to work so it's just you got to put 255 and at this point you really can't control the brightness of those LEDs okay so I begin the text and now that I've begun it I need to do print Ln what am I going to print to The Matrix my message like that okay that looks good and now I'm going to matrix. end text I finished my text and now I'm going to matrix. end draw so just like I begin those things I've got to end them okay I've got to begin them I've got to end them and then after that I'm at the end of my for Loop okay so we're going to put this we're going to write this string to the Matrix and so now let's come in and let's see if we can run it hopefully I didn't make any mistakes ah what did I do ah string what did we forget I haven't been watching the comments but hopefully one of you guys caught that okay still an error begin draw let's see ah font like that okay you guys see that I uh I'd used all uppercase let's uh in text should have an open close you guys be Pati it's hard to do this live okay we'll come over here and I've got a w and an e what is my problem welcome to toptechboy do.com won't fit on the screen so what do we do what would we need to do in that case what we would need to do is scroll it by we need to scroll it by and if we are going to scroll it if we are going to scroll it over here after the begin draw I need to tell it a speed text scroll speed and I'm going to scroll it at 100 now you would think the larger the number the faster it would go but the larger the number the slower it goes 100 is good but if I made it 200 it would slow it down by a factor of two okay so I do that and then the other thing I need to do on my end text I need to tell it to go ahead and scroll underscore left you could probably scroll right if you wanted to but that makes it kind of kind of hard to kind of hard to read so let's try this it's going across going across we're going to live dangerously and hope okay well to top Tech boy.com boom okay now did you see how that kind of glitched at the end what you uh what you need to do is you need to come over here and what I found is it looks a lot better if on your message you'll put some leading spaces and on your message you'll put some trailing spaces like that and then it's not so awkward as it uh why do you have to capitalize scroll text because that's the only way that it'll work if you try try it without capitalizing it but isn't it kind of goofy that scroll left is all caps but they decided to make font upper lower I think that when you're defining these libraries if you're going to use uppercase use uppercase but don't switch between different parts between uppercase and not so let's try this now and what I'll do is I'll come back over here and let's give it a chance to download and it has started do you see how it it it started more naturally okay and watch it's going to end more naturally too top Tech boy.com it Scrolls off the screen and then it should come back again there it is Boom okay why was there a delay because it was rendering and scooting those blank spaces now you could play around with those blank spaces to get things that look you know visually appealing to you now imagine that if I measured temperature and pre temperature and humidity I could just scroll the temperature and humidity by the screen whatever I'm doing like if I have a remote Gadget that I make I don't even have to put a display I can just scroll the data by on this built-in Matrix so guys give me some feedback I I hope this wasn't too confusing but I think I've given you some really cool things to to to learn and to work on here give me some feedback okay let's see uh Andrew bye we'll see you later could you show the scrolling part of the code please okay the scrolling part of the code is here okay you've got a that is the part Benoy that I think you want to look at okay cool stuff drd I know that you're going to get this working and you're going to show us some wonderful stuff I've been really enjoying your homeworks Dr Dave you've done some cool stuff I believe you were the one that put a little foam over your uh neopixels to make them really show up excellent stuff haven't been using the LED Matrix at all now I will use it every day thanks Jonathan okay great will be cool to play around with show the screen oh yeah yeah yeah okay there it is that's what benoi wanted to see okay yeah it's like an in included LED screen and given that we can scroll text in the text is readable that's pretty powerful right that's pretty powerful it's like an included yep uh full I I would love this to be full color someday maybe the R5 maybe they'll put full color on there okay BBF I have put the code up there I'm apologize that's like what four times that I've done that I need someone in the control room that's what I need I need someone in the control room but we're kind of a oneman show here we're a oneman show okay uh guys that's kind of what I had uh that's kind of what I had prepared for today but let's have a little Q&A again what am I trying to do I'm making Advanced lessons right now on the Arduino but those Advanced lessons are dropping in like August okay so you guys that are a little bit more Adept at the at the Arduino you're going to grow impatient as I'm showing the basics of like variables and for loops and if statements and things like that so what I'm hoping is I'm hoping that if I'll if you guys are interested I can drop in some live streams that show you you more Adept use or some of the more advanced concepts and then the new guys can just continue to learn step by step as they go through the lessons and I've I've got my lessons made pretty much to the end of August for this series for the uh oh look at that the little fisherman out there wonderful uh catching the Nile perch in the tilapia but I hope this would maybe be something you guys would be interested in so we don't leave the new guys behind even the new guys could watch the live stream and sort of see what's coming but then the overall series of classes is very methodical step by step and doesn't leave anyone behind Okay hey Beno got it working great uh awesome live stream great job working the controls well thank you Stephen I appreciate your patience Brian this is fun thanks for getting us up and going okay I think I've given you enough Brian that you can go out and do some cool stuff uh boat guys I want to learn I love watching the guys in the boats and sometimes we go out and wave them down and buy a fish from them okay uh yes please more live streams very interested yes uh Paul any laughs okay well thank you van I appreciate it hey I don't think I've told you hello I'm glad you're here V uh should we use the knowledge we have for the homework or stay with what you have taught us you guys that are more advanced go ahead and go beyond what I'm asking you for because that'll motivate the the guys that are learning they'll see just where we're going with this and'll kind of keep them interested I think that's good Todd I'm really struggling with this code can you suggest something else I can look at to get better which code specifically are you struggling with Todd have you taken the first three lessons in the normal class that I've done hey we've got another boat way back in the background it is 7:04 here so this the the Dawn is Breaking back in the background beautiful morning on the Nile this morning uh Todd tell me what you're struggling with because I'm not exactly sure let's go ahead and take a few more comments come on you guys give me some comments is this something that you like oh yeah Todd C++ you've got to get used to it and so just go back take the first couple of lessons again do it step by step I really step through those lessons pretty slowly so you should be able to do it hey Arduino hey Eduardo Eduardo thank you uh I really appreciate the feedback circuit design and Analysis would be great okay guys I am thinking about starting a class in some months here on circuit design where you would be using resistors and capacitors and I would show you how to do circuit design why because a lot of people know ohms law of voltage is current time resistance but it is grossly misapplied and a little knowledge is a very dangerous thing ohms law V is equal to I * R it's not just any voltage and it's not just any current and it's not just any resistance it is the voltage drop across a specific component is the current through that component times that component's resistance and it works simply if you only have one resistor but when you start having multiple components you guys are just grossly misapplying OHS law and what I would like to do is I would like to design more complicated circuits analyze them and then test them it would probably you would need a a digital volt meter you would need a power supply and then you would need like a a pack of resistors well you've got the resistors in one of the kits that you have you would need a voltage Supply and you would need a good DVM it would be about a 100 bucks but I would take you through methodically how you analyze more complex circuits where you might have a series resistor and then two parallel resistors and a series resistor what is the voltage drop across each component and what is the current through each component and I could take you through that step by step so you guys let me know if that would be interest in uh are you going to post your code on toptechboy do.com Ken I'm not doing that too much because what happens is it becomes it becomes too tempting for people to just jump in and copy my code instead of learning to code so I want you guys to learn to code and what that means is you make mistakes you find mistakes you troubleshoot your code you really have to think through it and when I post the code people just get lazy and they start copying and pasting what I have done uh you could build a macro keyboard to control your screens uh yeah that's a good idea Mark uh hello uh from man uh just uh great to have you here Olman thank you uh Mark uh em a newbie hey great uh that's good Mark hopefully you continue to to join the classes love having you on the live stream uh yeah I would I would be very interested in in the circuits class to do the 555 timer but that would be further along I want you to understand the mathematics of circuit components and how you figure the voltages and the currents I would start with that and then maybe we could do some digital logic 555 timers maybe some operational amplifiers so you guys give me feedback because I don't want to do a class if there's only going to be five people that want to take it uh time constants are interesting uh okay Brian yeah that's uh that's true charge discharge rates of capacitors yeah uh Brian we could do that but to do that we would need an oscilloscope and an oscilloscope is about $150 and so I'm just afraid if I did the AC analysis that it would require an oscilloscope and then if it's a hundred bucks for the DVM and the components and things like that and then another 150 for the oscilloscope you know how many people are are interested in dropping $250 for the equipment for the class I would have to find that out but yeah the math for capacitors you have to use imaginary number numbers and so the math gets really really interesting and I would love to do it but you guys would have to have a uh you guys would have to have an oscilloscope love to see a class showing how to connect the R4 to the internet Larry that is on the books I've done that uh really Jonathan you need a real oscilloscope uh those little things that you build yourself they just won't do it for real circuit analysis circuit design would be awesome please add the lecture to the R4 lessons or start another group group okay that's an idea don't give up if this didn't work for you you can always watch it again in PA yeah you guys BBF makes a good suggestion watch again and pause okay uh let's see what we uh what we do here uh this type of class would be good for guys to follow I think that's true I would like more electrical engineering yes that's what I want to do thanks uh takes me back to my apprenticeship in the 70s yep I love playing with the transistors showing how to de bug would be great as well yeah we'll do that as we're going through the classes you see that I kind of deliberately make some mistakes so that we can do some debugging and then we've got uh math all right drd yes circuit design would be good coding live is difficult indeed it is BBF thanks for your patience opamps are fun math is our friend all true how often do you think you will be doing these live classes well once or twice a month I think I don't want to I don't want you guys to get weary of all the stuff I'm dropping but maybe once or twice a month would be good man is in for the electronics class John I'm following along the 2020 class currently with the Wi-Fi I'm sure the projects will be different what projects are you most excited about with the R4 I love that 10 AIS uh chip that is in the kit I'm going to be doing a lot of work on that pcbs it's too hard they're just too many parameters and it's just not something that I want to undertake is is teaching pcbs it's it's it's tedious to me uh show us how to figure square root long hand that is that that is a tough one that is a tough one okay hey Ken you got it working good deal what's the key you don't give up you don't give up you keep going okay guys we're at about an hour and 10 minutes so I am going to go ahead and shut this off but on the video leave me some comments to let me know was this a useful thing to do in a live stream these supplemental live streams give me some feedback back cuz I don't want to do them if they're if they're not uh valuable to you guys okay I've got to move on with the rest of my day so I'm going to go ahead and sign off you guys uh leave a comment when this video posts share it with other people because the world needs more people thinking like an engineer and fewer people sitting around watching silly cat videos Paul mcarter with toptechboy do.com and I'm signing [Music] off
Info
Channel: Paul McWhorter
Views: 8,773
Rating: undefined out of 5
Keywords: STEM, LiveStream, TopTechBoy
Id: uoQuZ5e_SsQ
Channel Id: undefined
Length: 71min 27sec (4287 seconds)
Published: Sat Feb 10 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.