 All right. Good afternoon everybody. As you can see I've got the chats turned back on this week so hopefully those are all set up correctly. If we do have some issues I may stop and juggle some stuff in OBS and see if we can get it repaired but I think the I think the chats should be going pretty good. I see a couple of messages in there. I do need to shuffle a few of my windows around so that I can actually see them on my screens. Pause this. How's it going to Devo Dessa and Be Autograph over in the YouTube chats? Nice to see both of you this fine Friday afternoon as usual. Just about there. Let's see here. Okay let me put this one back to here as well for the Discord. How's it going Paul Kuller as well as Katni? Thanks to both of you. We're tuning in and I think we're actually ready now so OBS can get out of the way. Actually let me throw OBS over in the background here so I can try to keep an eye on it. I really need the preview. Okay wow that's probably the chat look all weird for a second but we should be all right afterwards. How's it going to Larry Bowman over in the YouTube chat? Nice to see you. So let's get the show on the road. I think we have over here circuitpython.org. So for anybody that might be new my name is Tim. I go by Fome Guy on GitHub and Discord. This is the deep dive program. On this program we are looking at all things Circuit Python. Sometimes we look at different stuff. It depends from week to week just what's going on. Sometimes it will be in the Circuit Python core or the Circuit Python libraries or surrounding infrastructure or in the case like we have today I will be playing around more with a Circuit Python project sort of user level code instead of core or library stuff. How's it going to see Grover over there on Discord? For folks that are brand new to this though if you're catching the stream for the first time if you've never seen anything like this if you don't know what I am talking about you can learn more here at circuitpython.org this is the main website for the project. Circuit Python is basically a version of Python that runs on tiny computers called microcontrollers. This one happens to be in a case which actually makes it not the greatest of examples. Let's look at a picture of what it actually looks like here. This one is a PyGamer device but basically this little handheld device has got a tiny computer on it and we are writing Python code that runs on that tiny computer and in the case of this device obviously it's kind of formatted like a little handheld gaming device so it's got some built-in peripherals like a joystick button's screen, some neopixels, a couple other things but more generally speaking these microcontrollers that Circuit Python run in come in all different shapes and sizes. We're using one particular device today but there are many many many different devices 388 right now devices that support Circuit Python and they are all different shapes and sizes and capabilities and functionalities and all these different things. So if you are interested to learn more probably the best two places to go are going to be circuitpython.org as well as the Discord which is linked down below on the screen down there the Adafruit Discord down there is a Circuit Python dev channel as well as a Circuit Python help channel where you can get help with your projects or whatever you're trying to work on or if you're interested in getting involved in development you can join us over in the dev channel stay up to date on all the stuff going on over there. Circuit Python is an open source project anybody is allowed to use it anybody is allowed to actually even port it to their own hardware if they would like to do so it is funded primarily by this company Adafruit this is their website Adafruit.com Adafruit's hardware and software company based out of New York in the United States they are paying the folks who work on Circuit Python there are a team of folks who work on the project full-time that are paid by Adafruit there are other folks like me who are paid to work on the project part-time as well as stream and do the things like this. Adafruit is the one making that possible so huge thank you to them and then if you want to help support the project one of the ways you can do that is by heading over to Adafruit.com and purchasing yourself some hardware from there they manufacture and sell the microcontroller devices themselves this device we have here this pygamer device is a Adafruit device you can buy that on their shop although I think it may be out at this point but they make all sorts of microcontrollers as well as little add-on devices which you can plug into your microcontroller and interact with things like sensors, buzzers, beepers, buttons, switches, levers, lights, speakers, sounds, all kinds of things like this you can get yourself all of those fun toys over on Adafruit.com and thank you for all the folks that do purchase hardware from there again because you are helping keep this whole thing moving let's see uh post I don't typically I don't typically post links for the deep dive although sometimes other folks do when we get started some folks like to click through the link inside the discord no worries uh so today's project is as you may have got a sneak peek of before we're working on this little conference badge thing this is actually for Katny who's in the chat here with us Katny's going to be heading out to Pycon in the upcoming upcoming week I think is it and so we are working on a project that will run on the pie badge which I should also probably show real fast since mine is actually a little bit different but these devices are very very similar this pie badge device here is kind of a slightly different configuration and a few other small changes compared to the pie gamer that I'm using but they are largely the same and the software that runs on them is very much you know carry over a bowl there's probably a better way to put that but we can write our program so that it runs on either device and it doesn't matter so much which one you actually run it on this is kind of designed to be a conference badge device you can do something like we have in the camera here you know hello my name is it can also do a couple other bits of functionality like showing an image with some text overlaid showing a qr code back to this hello my name is and then in this case we also have a menu which will allow us to launch some other circuit python scripts so we'll get into some of that kind of stuff later on but the specific bit that I'm actually about to get started on right now or I should say get started working on right now on the stream is more to do with a remote control thing that this does so if we look in the serial output which we will need to rerun it for because I did miss when it printed the first time one of the things that this is doing is connecting to the wi-fi network and then posting a web server that responds to a couple of different URLs here and so we're using these URLs to actually have some kind of like remote control buttons to do some different things on the badge right now what we've got set up is being able to turn on the leds and set the color of those um let's see next wednesday leaving for uh picon do you folks ate a fruit have people going to ashua hardware summit at the end of the month good question uh and I do not know the answer myself although somebody else may here we go um so if I load up the browser we can also just navigate to the ip address of the badge which I should mention as well this badge has um ordinarily does not have network access but it has an airlift feather wing on there which is what's giving it the the ability to actually connect to the wi-fi and host its server and stuff interestingly we got this thing which looks um suspiciously like a weird random chunk of html that was duplicated or partially missing or something I think I'm just gonna refresh here and see if that uh goes away yeah I was kind of expecting that it might um I guess in that case is just we didn't like we received a jumbled message or something on the browser side and for some reason it didn't realize it um and repair it or ask for the data again um that is pretty weird I have not seen that before with this particular project so um what we have here though we are viewing a page that's hosted on the pie badge so right now we're actually connected to a server that's on this pie badge it has loaded up this html page for us which is from static index html which is just a file that's on our device this page has a color picker on it so we can click on this use a color uh and then we can click on set color and this will turn on the neopixels and set them to the color that we selected I will say the uh the camera that I am using is not the best at picking up neopixels that are directly kind of like shining right into it um so the color does not look a hundred percent you know necessarily to match up like with what we saw over here um but that's kind of how it goes with the camera that I have available you got to set a blue like this uh one thing I have found is the darker colors are kind of nice because by default the neopixels are very very bright so if you choose like a bright blue uh then it's going to turn on full blast which may be what you want but sometimes it's not so like that see this one is uh much brighter I don't know if it comes through the camera quite as well seems like it's it probably does just because you can see how crazy huge the uh the blue halo is now um so I've been sticking down towards the bottom half of these for the most part while I am testing them uh let's catch up over on the YouTube how's it going Johnny um as well as grumpy fpv how's it going my friend uh the ir camera menu item is because we also have yep uh catney mentions in the chat there uh she's also got a amg 3388 uh which is a thermal camera leave right uh connected onto that device as well um so the badge when you go to select here you've got a couple options one of them will be to launch a script that interacts with that thermal camera uh the other one will be to launch the snake game uh which will actually probably also make a few tweaks to that snake game uh as well once we get in here what color are you picker are you using good question I'll show you in just a second here color picker is it is a third party color picker I tried to use the stock one in the browser at first but uh my phone's browser so my phone or my computer both now I don't actually remember which browser it was but um one or both of the browsers they only gave me a list of colors to choose from like you know here's 10 colors choose the one you want rather than this one where obviously we get this whole kind of like swatch where we can choose uh anything in the rainbow and any you know lightness darkness all of that stuff of it and it is called this color uh color wrists I'll link that one uh I think that one in the chat here this is what that is my 3d pretty case we'll have a thin layer of white filament over the neopel oh yeah yeah yeah that's that's actually the way to go is like a cover on the neopixels like that paper or plastic something like that to um kind of deaden the brightness of them goes a long way honestly uh towards saving your eyeballs with those things for sure um so that is our color picker what we want to do is add some information to the page we want to add some information to the badge itself on the screen um so that's what we're working on one of the first bits of information we want to add is the ip address which it is printing in the terminal down here somewhere um but we want to show it on the screen uh I guess probably what do you think cat need the uh do you want to show it on the same screen as the qr um or show it on like the image one like this I get I kind of lean towards the qr personally because this one I assume will be your name and maybe email or something the same way as as it is in here I always forget which one of these is which it's qr code on so so I think if we uh if we scooch the qr code maybe up that way it's away from the neopixels which might hinder the ability to scan it if somebody was trying to scan it if we scoot it up then we'll have room below it and below it we can put some text so let's see if we can't figure that out paper works well yeah that's usually what I end up with on my desk here is just a uh piece of like printer paper and a draped on top of my neopixels same screen as the qr so this is um partially kind of the stock pi badger example project so let's see where it's going it's gonna be saying show qr code here let's look inside that a bit uh we may need to tweak a few things in it from the user code here in order to shift it around some let's see uh but it's all mpy files of course I think I'm gonna get the uh python files of this for now just so I can look inside of it more easily whoa let's go install aida fruit pi badger dash pi about qr yep yep the uh the ip uh of the page is actually yep it is embedded in that qr so you can scan that as well with your phone and it'll take you to that color choosing page into here now um yeah okay so that's gonna make a qr code it's gonna make a palette for it it is gonna make a group called qr code and it's gonna say self.display.show qr code right here it's setting the height and width which is this so we should be able to uh change well not the height and width I should say not the height and width but the x and y actually we should be able to change the y by getting access to this tile grid and then just resetting the y on it which I think we can do by is it recreate this every time it does it might be good to create this once um and keep it but that's kind of inside this library not a thing for this project okay so we will be set to qr code which is the group and then it has only a single thing in it which is the tile grid so we should be able to say after we've done this we should be able to go high badger.display.root group this should be the group that our qr code is in if we go zero that should be our tile grid if we go y equals zero that should move it to the top of the page did I really did I really forget again or is it broken maybe it's broken or you know what it might actually be doing is still firing up the server most likely yeah that probably was still firing up the server yeah there we go okay yeah see now we're basically right at the top edge there so we've actually got a a thicker strip of space at the bottom there where we can put a label so if we wanted to add a label to this um we could we could create it right here and then add it inside of the group um I think we don't really need to create it like right in time we could actually just create it ahead of time and then um we add it to the group I don't know let's actually try it we might have to we might have to create a new one each time we might have to but I don't I don't think so we'll see some folks don't like arbitrary yeah qr codes does get weird with the stickers and stuff people can put on top for sure uh trick is to wait to press the buttons until the display goes dim I gotcha we could do some kind of uh maybe put a dot on the screen or something make like like some subtle thing or um it's set the neo pixels I guess actually as well when it's ready maybe it sets the neo pixels to green or something um that would probably be a good idea to have something to show once it's done setting the screen up um the dimness works too generally because I think it's 10 seconds which is usually right around the same time as its uh speaker it can beep the speaker but it depends if it has a speaker I don't recall if the pie badge does for sure or not um okay so we want a bitmap label I think which we're gonna have to import my display text dot bitmap label import it's just called label though that way the api is the same we're gonna say uh web what are we gonna say we're gonna say um rc details for remote control details label equals a new label but not leblay um text is let's just do that for now um other things are what do we need anything else um yeah we want to put it at the bottom of the screen in the center I think but yeah yeah yeah we can do that here can do that here dot uh anchored anchor point uh zero no uh 0.5 and 1.0 so middle bottom rc details anchored position um x is halfway through the screen so pie badger dot display dot width over two over e that's not quite what we want uh and then why we want pretty much all the way at the bottom so that's gonna be pie badger dot display dot height and maybe just like minus two or something so that it's not like literally touching the bottom oh I did it again um okay 119 seeing hard positional argument um right right the font it's the font terminal i o dot font we'll have to import also see if I got that right if I'm still if I still don't have it right then I'll uh go look at the docs so to keep trying to do it from memory but I think maybe we got it this time there we go okay so I have not added it to the screen actually so visually nothing has changed yet but that's fine um we created our label so we should be able to now go something like pie badger dot display dot root group dot append our label now what I don't know though is once we change groups is this label still gonna be is it still gonna be in that group and therefore it's not gonna let us append it the second time also we need to put some text in this right now it's blank let's put uh just let's just put hello for now that way we can actually make sure it's showing on the screen I always like to go in like really small steps and I can right I did it again okay yeah pixels let's do this for now also so I stop uh after what server let's go pie badger dot pixels let's just do the first one equals maybe like a little bit green not very much just a little bit may not need the the light on the camera right so now when the server is running one yeah one new pixel will turn green there who interesting we don't have our label um the color maybe the color is wrong uh stopped myself uh let me catch up on the chat over there as well uh speaker let's see I think in case already would be keen something more subtle than the neo pixels would be ideal we can do that uh doesn't run the deming code until the wi-fi is fully connected oh interesting okay I thought it was just on like um the accelerometer basically as a buzzer okay uh we want this one um a label is our tile grid bigger than I'm thinking just covering up the label but we're putting the label after the tile grid we create this right here and add it do we see it not see it um if we make the if we make the qr code hidden do we get to see it then this will tell us if the qr code's covering it up which I don't really think it is but maybe I almost want to I almost want to disable the server for a moment that is really weird where is our label going does it have scale does have scale um so I think the scale throws off the x and y most likely because when we're setting the anchor point in the anchor position up here it doesn't know anything about that scale right because we haven't even added it to the group yet um even once it does get added to the group I don't think it knows its parent scale anyway so just put it at the bottom of the screen when it is scaled I mean this kind of assumes that it's scale too I guess I should have printed the scale probably but it's not see what the scale is on but we gotta press the button a grid has no scale so I think the answer here is we probably should be on scale three actually probably is too big truthfully we want to keep the scale of the qr code but we don't want the label to be scaled by three uh because it probably won't fit on the screen also I don't even know which values we would be putting in here to scale by three be divided by six I guess sure that's right anyway though I think we don't want to do it even if it is right because like I think the text is gonna be too big it is finally on the screen it's nice um but it's much too big we if we put an IP address I mean first of all we're hiding the qr code which probably will be covering up part of this but if we put the IP address it's probably wider than the whole screen and even if it's not wider than the whole screen we have zero extra room for anything else uh so we want our label to not actually be at scale three which means we need to basically make a new group I think um go qr screen group is a new group this one's going to be scale zero or one I should say just normal what we're actually going to do then is I'll show qr code we then get the scaled qr group which is currently now on root group what we're gonna do is go that's that but then what we're gonna do is we're actually gonna just for a second make this none or make this actually this qr screen group which is scale one we're gonna make root group this and then we are gonna add the scaled qr to it and since we are just creating this group and keeping it I do think we can actually put this back up here so that we don't have to create it every time and we can actually add this to the group all the way up here as well the label is in there I don't think we want to add it yet actually is there a remove all but we could just call pop fix out of range if we keep calling pop until we get an index error that will remove everything which I think we'll want to do well it's not empty remove things from this but this should also be all right that doesn't work for some reason troll alt t is supposed to be surrounded with but it's actually opening the terminal kind of error was this index it's false it is empty and then we stop looping because now that's false so pop pop pop pop and then stop looping show the qr code set the qr code group into there show the qr screen group add the qr to the qr screen group add the label to the qr screen group as well we don't really want this we don't need scale anymore don't need to add this because it's actually back here should probably do this before basically right after that so now we should have scale one text underneath scale three qr code except for we're in the terminal but also I left my divisors all wrong should be back to actually divide by two and this should be back to not divide by anything it could show the qr code page when it's ready then you can always just click the button to go back there we go now we have hello down there below the qr code that's what we wanted um except instead of hello we want the ip address which is this I don't know if that will all fit but we'll see kind of we're really close to the qr code um let's do line spacing 1.0 I'm pretty sure the default is like 1.0 something let's also try without this and see if we are touching the bottom or not pretty streamers like ip alone is fine we can do that I feel like HTTP the only the one thing that I think is nice maybe about including that is a lot of phones might default to HTTPS I assume will not work so some browsers you may actually need to actually type the HTTP but some browsers you may not this works actually if this works then there's no then there's definitely no need to oh that one doesn't work okay no worries okay the browser there so this will tell you how to get there I think my phone is over there playing music I'll look in the which is qr code is yeah qr code is pointed to the same thing as well which is the ip address so that should open up the page for us okay there we go cool um next thing we want to do is make the page better basically in a few ways for one it's like all cramped up in the top right corner and it doesn't say anything and it doesn't it's like super duper bare bones it doesn't have any style or anything what we want is let's see um I will we definitely want I think like a header of some kind just like a title or something because like right now it's just like stuff at the top of the page lots of pages will have something that just says like what it is or something and then I think we could probably put the things like in a line in the center if we put these three controls in a line in the center then it will be like a a remote control on the phone basically right like we'll be making use of the portrait because like a lot of the well my browser's doing it won't connect with the hdps yeah I was so I was getting ready to say probably the majority of people will be viewing this on a phone since it's at a conference but it is at a conference for python so like probably the vast majority of attendees actually have a computer um so we'll want to actually probably keep that in mind as well there could be people viewing this on the desktop um but I do think kind of down the middle here here and then it will just the middle is always the middle and so if they're on a phone then it's like this and it's down the middle here whereas if they're on a desktop it's down the middle here and we've got lots of room for it um off the top of my head I think the way that I would do that at by default is probably flex yeah exactly what I was hoping for make it prettiest for mobile okay we want I think like flex which one of these had flex column in center of this this is pretty much what we want we want each one of our items to be one on top of the other some of these things I don't think will be critical for this we'll cut out some stuff if we find that we don't need it one thing we definitely don't want to need tomato color going on or we don't really need the order either I'm gonna comment it though in case we decide that we do actually want to see it if stuff is looking weird it's just flex item we don't need background color padding we'll see what the padding looks like width we don't want to do these things I don't think I'm not sure if it's gonna be mad at us if we don't it's gonna work if we don't have a width press so that stuff should be fine so now if we put each one of the things we have into a flex item oh and we need rows too or we need one row flex container one row and flex item we're just gonna make a couple of those and then put these things inside we could probably just give flex item to this have to hit the sack uh good night all yep uh take it easy Dave Odessa we'll see you next time hope you have a good night and we'll wait wait for that to load and view it on the device but I'm also gonna try like this yeah there we go so now we got a nice vertical stack I don't know where our h1 went though didn't we add an h1 is it white maybe it's white or maybe our rows height is messing it up oh it's white flex item has color white uh this is to do with the h1's padding I'm pretty sure let's make it a span instead of an h1 and then we could make it bold or whatever if we want it's preference but I tend to think sans looks a little better uh maybe a little bit more space between these items vertically because we do still have like a lot of empty room um and in particular the ones which you have to touch especially on a phone it's nice if you give people some extra padding so that they're not accidentally hitting the thing above or below it um we can do that with probably either padding or margin don't think it matters or probably we could do it with uh maybe not I don't know I'm pretty sure there's one that can go on the parent that determines this as well but you know what it's called up the top of my head gosh it's such a minor thing but it kind of does bother me a bit that this is a button and this is a link does that bother you catney it doesn't bother you I can leave it um it would be nice if the button font was bigger not even if we do leave it though because like we have dragantor link and then like teeny tiny set color it does look weird like that um um let's go button this oh whoa whoa whoa size size does bother me okay uh let's try I don't know I don't even honestly I don't even know what um I don't I don't know what okay that's a little touch on the big side just a little bit it's messing with our uh it's messing with our margin as well interestingly so we'll be back in a few yep uh take it easy we'll see you when you get back uh guess this is because button somehow grows outside of its parent for some reason can I change the height do we have to have the height of this hard coded if I just take that out does like can work better yes and now yeah this is what we want now now each thing will grow to be however big it needs to be to fit the thing that it contains much better um so off can we make off a button yeah we can make off a button it can just be maybe be a button inside of here I don't know if that will mess it up so that we get all buttons then uh this is not the live page here so if I do stuff it's not actually gonna work if I come back to this one I could leave this here it doesn't really matter okay well we will be one thing we cannot do is give it a totally bogus one with an L there actually running Wi-Fi okay it was rebooting from the last time I saved the file or something oh and now it's going to this L again built an update server that making it restart let's just close that one color thing color thing did not get initialized probably that means we have context error just getting a bit of weirdness like this the other day got stuck feel like sometimes we're not transferring the whole thing successfully because we're getting stuff like this I don't think this is in the file let's start deleting these things also try to cut out any empty lines that we don't need to keep this as small as we can welcome back here we go well it does still say this kind of stuff illegal character stopping it from running too it seems like always finding it here there's nothing there so it's like interrupting the javascript somehow that L so here at the A it's the same place every time this has to be like an escape problem right but it was working before we added like style and stuff um okay slightly revised plan what if we host the css and the javascript in a file just on github and then load it remotely through the page so or rely on the user's computer connecting out to there for those two pieces the thing i'm gonna check or i try all the way what does this do if we take this and put it here and then just change nothing else we still get the um we still get this it really seems like it does not like returning that string if we can re-factor the javascript not to need it what is this oh weird just by charm showing me something weird kind of trying to do it with the extra one so if the extra file lives on the lives on the badge then it is trickier i think then if the extra file lives on the internet although i'm not sure which way you tried i'm gonna i'm actually gonna try with probably just the javascript first actually well oh i didn't so totally not mean to do that good thing that was python and that obs though huh right it's like did i not just change this code yeah i did but it was in this over here that source so now instead of loading script j well instead of just having javascript raw inside this file it's gonna load it from this file over on github which means that the wsgi server inside the badge does not have to return the javascript directly which means my suspicion of if the weird characters in the regex are bothering it if that is the case then it will be fine with it this way because the resource from this was blocked no sniff that might make it trickier so basically i think is that telling us that github returned this with a text mime type text plane instead of javascript library lights controller does have a color wheel selector i forgot implemented that already in this it even said take out the branch and i put it right in there didn't i there it is okay and then this actually has the right mime type question mark that's the favorite con i don't even see a content type well but it was 304 so application javascript utf 8 i wonder why github does that there's something you can put at the top to force it you think it's js i do not know if so that would be a github convention more so than a javascript convention i'm actually surprised that it does that i don't i can say i've ever given it a whole lot of thought but i would not have thought that that's what it would do i would have thought that it would basically check this and then have a list of known mime types that it uses oh let it reload because we waited too long saved again or something reloaded as soon as it in i also don't have t of anymore because i corrupted content but not found did i copy the url wrong i did because it has main definitely shows up got the main in there so it returned us a 404 with an error message that was text and it was still plain text so when we request the right file then it will set the mime type for us there we go looks green there no issues here firefox does remember the color here i don't think all browsers do that but firefox does mega green boom we got mega green this is the fake one it just reloaded itself oh actually the code reloaded i think my computer sometimes is writing stuff to this causing it to reset expect if we ran it off of uh the battery only do we get a lot fewer resets there's our blue it turned off there's our turn off we did get this weird thing again seemingly still working though because we got red okay what does it look like on a phone i'm gonna close it here what was the project for the uh this project here is just oh did i go back and delete that i left that in it actually you can always take it out too if we if you don't want to recall right i think you said it was okay to leave it but then i did come back and delete it anyway it's like getting ahead of myself a bit that you can't really get it to where the uh everything is in focus all at once but it's got the ip address in it put it up on my phone um it's kind of comically tiny and in the center i'm pretty sure we want this thing um i'm pretty sure we want this side index um the project is for just um a badge to show off at picon it's kind of to show off the circuit python generally but also a couple specific pieces of hardware like obviously the badge itself and then in catney's case the thermal camera she's got connected to it as well as the air lift featherwing being utilized to kind of sort of iot send send triggers to the device in our case those triggers are going to set the neopixels um but it could do anything obviously i'd actually change these size so tiny little scaled big disable auto reload just turned off resets in boop i oh i just turned off resets the syntax change recently though can you uh how do you so then do you do like um just still control c and control d we have put a smaller number i feel isn't zoom in is what we want though right don't we want to zoom in still do control c and d seven i don't necessarily need is oh oh i see seven it catches it and then does the old one fair enough yeah so we could keep that we might as well have both so now theoretically if we modify this and save it it won't reset it's still reset do i have to uh but i have to use reset button once because we changed boop there we go yeah now it doesn't reset oh yeah now it doesn't reset when we just go thank you for that uh okay let's get it from the browser phone browser i'm sure if i should be like be loading or going all the way back to scanner okay wow that's uh not quite i must wonder if i got a cached version or something last time try two i mean two is in between i usually one solves this though usually i set this to one and then that's like it i wonder you know because my code oh no it doesn't it reads it at the beginning that's right yeah we do need to control c control you see because my code reads index inside the route but that's not true does not it does it at the beginning here i'll try refresh next time okay so i think we just didn't get it i think we had it i think we got a cached one honestly because two is like that which is still a lot bigger and not all the way on the screen obviously i'm pretty sure one actually should do what we wanted initially and i think maybe i just did not actually get updated version of it when we refresh the first time we're gonna rerun this i will try a refresh instead of reloading it but then i'll reload it if that refresh doesn't work there we go yeah yeah yeah yeah now we're good that's what we wanted right there it's like fits pretty nicely on the size of the phone there and choose our color that color we turned it to red there i did zoom itself out here i think that's again though because of the way that i had it cached i'm pretty sure if i force refresh gonna give me the big one just by that though yeah okay now it did yeah now it did i'm pretty sure people who view that for the first time if they had never viewed the small one like me then it would just always be correct on theirs always be the big one basically uh so we should be able to go off zoom lights off go to a nice green color here that color it's maybe closer to teal but you know no colorologist okay we're looking pretty good here i think um what else do we need did you want um if you are back around again catney which i think you said you're back did you want the page to say like like hi i'm catney or anything like that and then do you want that link out to your website or anywhere specific go below this one this is so much shorter my website this holder you know what i just figured out what i wanted to say can you put some place holder yeah definitely i'll put you we can actually just go this holder here then i'll put a place holder link also then you can always just delete any lines that you don't end up wanting to use link place holder this one can be anchor just go maybe circapython.org for now it could leave a blank as well but should be able to modify it okay okay there's now seemingly all of those are the same size two oh okay yeah yeah wait title is bold wait a minute class title is bold and sans serif class title is on this but not on these two but on the page they all look the same which is not really a problem but is not how i thought css worked to be fair have that phenomenon often with css um yeah i don't know that's weird it's kind of it's behaving like we had put title on all of those even though we actually didn't that is even more weird actually this one's different this has the serifs so the this one is treating the font differently this one is more like what i expected maybe my phone just has a sans serif default font that looks bold i would not be shocked honestly there's a lot of weird stuff about not only android but my phone as well that's probably what it is it does look fine here it could also be smaller as well if it didn't need to be so big if you want like subheading or whatever uh it could be something like title is and other spans are yes one of the great mysteries of the world for sure and could be smaller still do sands and then i think maybe it doesn't need to be bold obviously all of this stuff can be tinkered playoff center now oh it has something weird in it we're getting these weird characters i wonder if it is we are kind of like at the limit of how much wsgi can return and be happy about i wonder if we're seeing those weird ones as we're adding more stuff to the dinner so you need to eat yep uh take it easy be back afterwards if you're still hacking yep i'll be around probably about 30 ish more minutes we'll see you around later on if you're back otherwise hope you have a nice dinner and a good night html headaches yep always headaches also i mean one thing we could do all also is like the css but we're gonna have the same problem aren't we with um we're gonna have the same problem with the uh i'm type i bet my assumption is basically we'll have the same root problem which is github is not going to return this with the proper content type i assume the browser is gonna have the same problem with it where but this is through js deliver also so maybe that handles that oh in fact this is literally doing the same thing i never looked at this code this is literally doing the gh this is pulling from github okay we should be fine then basically right we can just use the same stuff so i'd say probably hug report to js deliver for having content type be set correctly since github does not for some reason yeah i think maybe once your page gets too big this thing doesn't want to return it all properly um that could be a bug in the wsgi thing which is inside of the esp32 spy library i will say there's actually an http server library which might ultimately be a better way to make this project um but i started down that road and was having out of memory errors which is why i ended up switching to wsgi version um but i would say like moving forward that would probably be like the library that would be the better one to start from um and maybe just figure out if we can tamp down the memory needs a bit but in this case i ended up switching just to get it done quick ready to go for next week ready to go for next week um i wish these buttons were the same width i would say that's probably one of the few remaining things that uh i would do differently if i could just change the page i can um fortunately now have to like go through this whole edit the css and upload it to github thing but so this ended up as about 164 pixels in width let's go 164 on both of these does http server work on esp32 spy uh yes i got it working but i ran out of ram i had memory allocation error from basically if i would request multiple times like if i would just load the page once and use it to set the color and then stop then everything was fine but if i would load the page again or try to set the color multiple times um it would eventually give me the memory error memory allocation error that being said like i don't maybe i did not set it up right it's very possible i did take a relatively quick stab at it um but that is what i found with with this project like with all the badge stuff as well so it wasn't just the server by itself it's also like being able to show this image and show the qr code and show the hello my name is and all that stuff so like it does have definitely extra stuff in ram um okay so the good news about the the the pleasant thing the nice thing about having our css over in this other place is that we should be able to just like refresh this and as long as it actually fetches new stuff then this should update even though we did not rerun the code on our device since now we have like an external link that did not work we do have this thing again let me just give it one more still did not work let's look we do have this button font size okay so we're not getting the new we're not getting the new style we'll maybe just wait for another let's see matters if i close that but i wonder how oh it says uh cached though at this time it was not cached but it does still have the old one the js deliver though might be caching it in between in which case we just have to wait for their cash to run out not necessarily also not the end of the world to update the index file in here the intention really like that i'm gonna i'll save it here i'm not gonna push it just yet though because i'm still waiting on the other one to show up for how often i wonder when their cash refreshes cd and js deliver let's get hub cash update does not through the gh thing though this one is or why i only did one of these oh they're they're both the same actually though i wonder why it didn't do the first one that's all a bunch of these that it doesn't seem to be doing or at least not commenting truly these people would have posted it again if it didn't work right this is such a weird plan a it was locked though no we can't do it or per jpi fair enough uh is this for the pi gamer it is technically i guess uh for the pi badge i think is what catney will have but the pi gamer is what i'm running it on and the pi gamer and the pi badge are close enough that it might as well be the same thing to be honest for the for the purposes we're doing they're basically the same thing like you could use them interchangeably for this project urge cash js deliver easy to use api of uh useful new version update will not work for can't use it anyway hmm okay um uh hola hey toros how's it going hosay louis berea over there on the youtube sorry if i mispronounced your name at all there my friend pleasure to have you here though um so let's put the version in i guess right this way it's a different file all this version 100 for now even though we happened to know there was other version save that we're gonna add it to the repo we are gonna commit it it back into our index page we are gonna call this style says save that and then restart then we should get the updated file and then theoretically we can change the version whenever we need to make a new one if we need to make a new one ideally it will just be now and then really need any more new ones i probably should have known better than that honestly because it was actually 164 point something 164 is probably too small so we are gonna go ahead and update that again actually to uh that's 269 let's just do 200 that should be plenty we also need to change the version number again fortunately we now have to like add this every time kind of a pain but i suppose we don't have to delete the old one we could keep it i don't really want to just keep adding new versions why is there a pie badge lc in a pie badge what's their difference good question uh one of them is cheaper that is the main like functional differences one of them cost less money uh the one that costs less money is missing some of the pieces of hardware which is how they're able to make it cost less money it has fewer neopixels it has only one neopixel instead of five uh what are the other differences there's a page that says this somewhere i'll probably mess it up honestly i'm not the best source for this uh i think in here um so pie gamer has a joystick that that's the gamer though not either of the pie badges both the badges have the four button d-pad the gamer again has a stereo headphone that the badges don't the gamer again has a loud speaker but does not have the buzzer built in i don't know why i was reading that section this is the section that actually has the stuff we want so pie badge lc it has uh it does not have the connector for the speaker so you can't plug in the louder speaker on the lc version but it does still have the basic buzzer uh the lc version is missing the feather header um on the back there's a female feather header which in our case is actually quite important to the project because we have feather wings plugged into it um so we would need that in order for this project to work the lc does not have the stem of connectors on the edge and the lc also does not have the accelerometer but then everything else is the same besides those four things between the pie badge and the pie badge lc and i want to say it's like about five bucks or something right this one is the full one and it's 34.95 although it is out of stock currently uh and then the other one i think is 30 if i roll correctly it's also out of stock unfortunately maybe did you key i don't know no none there either of the lc at least that they do have pie gamers though i happen to know because i looked it up the other day yep those are the differences for it my gamer looks more interesting um it's pretty cool i certainly like the pie gamer but i'm also kind of a sucker for like video games basically right so i i really like the idea of being able to make your own little video game inside that thing which you can do for any of them but the gamer is the one that is kind of more heavily focused towards that the joystick and the stereo headphone kind of add a lot if you are making a game depending on what kind of game it is although like a d-pad is functional enough right like you don't need a joystick so um let's refresh this i think right we should be able to get the latest version with wider buttons i think yeah there we go that's what i'm after okay that's looking good let me double check on the phone put it to a red put off purple here my badge makes a nifty front panel then to uh uro rack type thing it looks like there maybe not uro rack i guess specifically it looks like just slotted a t bar aluminum yeah the buttons there you go that's a nice idea because then you've got a full little control unit in fact yeah that's actually a good tip using the pie badge as like a the head of a whatever doodad right it gives you a screen and it gives you all those buttons which you can use to scroll through a menu and do actions um a lot of projects will want to have that basic functionality um 15 minutes let's uh let's transition a bit and work on the snake game so in the snake game i think there's a couple of things we want to do um we we do want to make a splash screen i think and we also want to make it so that when you run into the edge you lose right now the game is in what i'll call like mega super duper easy mode which is that the only way to lose is to actually run into yourself which obviously is like the traditional way to lose a game of snake um but also typically in most implementations of snake if you hit the wall i think you also lose so the point is you have to like turn you know up or down or whichever wall you're going right you need to make sure to turn at the last second otherwise if you head into the wall then typically you lose this implementation it's not set up like that yet but we're going to change it so that it is another thing i'm going to make sure to do here real fast is actually update my index file inside of the repo and then i'll wait to push since we're going to modify snake as well this way i can push one commit with both of those changes and so snake is in its own file one of the cool things about this is the way we have it set up for launching other files it's actually using that supervisor next code file so it's actually going to set the next code file to be you know in our case snake or maybe the thermal camera script and then it's just going to reload so that it will run that next code file the next time it boots up which is going to be right after this reload happens it's basically going to reboot it that way we can launch any other kind of like third-party external scripts that we want just as demos of different circuit python stuff in our case we want to find the snake one stalling a little bit while i find and doing a poor job of it but now we're finally there and we want to make snake a little bit harder this is like super duper training wheels version you can just kind of you can essentially just pause indefinitely by running into the wall in this version which i thought was kind of nice because you can like just run into the raw the wall real fast and then put the badge down and like have a discussion or whatever and you don't lose but it does make the game a lot kind of less fun right if you can't lose right so i think what we want is want we want well it's going to be inside of like move snake i guess if not game over if not paused if it's time to make a step then call world that move snake basically what we want is all these returns right here these are us pausing when we hit the wall basically it's saying like if the next place that we're about to move the next square you can think of it as a two-dimensional grid if the next square that the snake is about to move to is greater than zero then go ahead and minus this one's going left which means it's minusing so if we have room between the snake's head and the left wall then go ahead and move left by one by minusing else it was not greater than zero it was either equal to zero or less than zero in our case it will always be equal uh it is just return which means it doesn't do anything it doesn't move anywhere doesn't do anything it just returns and then next iteration it checks again but what we want is to lose so we're going to go raise game over instead of return we're going to put this in all four of these and then that should that should make it so that um when you hit the wall you lose let's go catney welcome back uh so you just plug in the feathers uh feather wings feather wings yeah one important note is feather wings can fit on the back of this so this is a airlift feather wing uh as opposed to something like this which is a feather uh tft feather in this case esp32 s2 tft you as far as i'm aware i mean obviously this one has no pins so you can't plug it in but even if this had pins you cannot plug this into here you can't plug two microcontrollers together so you can't do a full feather and the pie badge or gamer or whatever but feather wing you can plug into that and there are all sorts of feather wings that do all sorts of different things we've got the wi-fi one here uh catney's got the thermal camera one loaded up on her version of this project and there are dozens and dozens of others that do various different things so let's give this a try in order to run it again i am just going to go ahead and lose that's going to tell us the score it says press start for codepie so we'll do that this will launch us back over to the badge uh we'll wait on the web thing to load up there's that and then we go select and select again to get snake there we are and so theoretically if we hit the wall we should lose now ooh still no maybe we need uh maybe we're probably off by one my guess is we're off by one let's think about these numbers real quick whoa portable air quality monitor nice looks pretty cool i like the case that that's in as well looks i don't know if it's for sure sealed with rubber or whatever but it looks like a nice uh weatherproof case honestly looks like it would keep out water and stuff um yeah yeah yeah yeah so we must be off by one right this is um so let's say for right if the direction is right if the head x is less than width minus one then we plus one else we i didn't save this i did not save this file i bet you it does work but you have to actually run the code that you're trying to run in order for it to run turns out i think even doing this whole reset i'm pretty sure we should be able to just launch it again now that i have actually saved it like it will already be running so we just let this go how da there we are interestingly your score is always three should we minus three from the score that's kind of a minor detail basically the score is the number of squares of your snake and since your snake starts as three squares your store your score actually starts on three or should we just start it on one why does it start on three i guess because if it's only one it's not really a snake it's just a block where does this tell it that it starts on three even how big is that john john portable air quality it's kind of big to carry around oh the air quality thing it's got a loop on it though right there oh i'm not scrolling up the one that you can see one that you can see got a loop there so it can be just clipped to something or whatever right if that's the thing you're talking about i actually i'm not familiar with this term i don't know if that's a word for air quality thing or start the score at zero okay so what we will do so we could either change the snake to only start with one thing or we can keep it on three and just change the score after the fact so where's score it would be in here i guess right um so it just says oh okay so it just says length of snake we can just go length minus three so then if you are on three you'll be you'll get zero you're on four you'll get one five two so on and so forth basically you just minus the three let's look in here if i'm curious now where does it say the length of the snake starting location in a starting direction then it has a grow function it has a size which returns locations locations the list which contains starting location john is a sling term local to philadelphia and delaware valley that may refer to a thing a place a person or an event substituting for a specific name on his context is uh dependent substitute a noun and the substitutes for other nouns interesting yeah i never heard that term but i guess it makes sense that i had not spent too much time around philly or delaware water proof pelican case made to protect cell phone okay nice yeah it looks super cool to me um starting location so starting location and 10 am i crazy or do we not okay first of all let's double check it starts on three it starts on length three right because that's why we got score three because i didn't catch any apples gotta wait for the thing yeah it's already it's already three because it can make an l you need three blocks to make an l oh did it work oh it still says three i probably didn't save again yeah in fact i didn't it's right here again okay that's fine if it out next time i do have minus three now so it should put it down to zero super curious looking back at this though like where on earth is the three even coming from we have snake starting location 1010 says inside of locations is now just going to be a list with starting location so it's a list of lists that has one element which is this list containing 1010 self that tail don't actually have a self that tail yet maybe that's part of it so when we grow we say which direction are we facing and then we basically find the x y coordinates i think this would be in the grid space not the pixel space but the grids of the last segment of the snake and then we go one farther than that and that's where the new one is going to spawn so we say locations that append new segment so we started with one this would add another one each time it gets called are we calling grow multiple times with eight defaults we start with one there and then we call grow twice which is how we're getting to three officially let's make it a variable oh actually that we don't even need to minus do we range what does range do starts on you go zero to two so we do need to minus minus one loop over this put this inside of here we only want to call it once per so this should still do two because we started out on three and then what we'll do is we'll minus this from score at the end so now the starting size is a variable and you can change it to whatever you want catch up on the chat uh why did i void why did it avoid my pie order um so i don't have any insight into the factory you're probably better off with like support than me but what i will say is i know pies there are a lot of restrictions on as far as like your account has to be you have to have an account you have to be logged in your account has to be two factor enabled um and then you're only allowed to buy one i believe so if you were not logged in or your account doesn't have two factor or you've already bought another Raspberry Pi those would be my best guesses as to why they would not have fulfilled it but those are complete guesses on my part i have zero insight into the factory or the shipments or anything else so i honestly don't know and support would be probably the better place to get an answer on that uh have a let's see here suggestion maybe make initial direction random that could be fun yeah we're going up always i think that's true i thought of adding a gps module go back to measurements location and time it's a great design so that's for the uh i think the error uh quality one cell phone underneath i feel like it'd be terrifying to carry around a lot of proof okay now we're there it'd be rugged and dust proof the idea this was designed for you uh young asthmatic relative go camping with nice it's live it's good to learn python i'm glad you like it um let's do save our file now and then let's do well we actually will restart just by going back to here so you have to wait on the wi-fi thing again and keep forgetting for some reason there we go yeah now we're still at three let's make sure the score says zero boom zero perfect let's make sure that it goes up if we actually get uh an apple so let's gain one apple and then lose and then make sure the score is one while that's working then i do think i'm gonna take patrick up on the plan of random starting direction oops that was not the arrow button that's that so now we'll just run into the wall we should get score one perfect perfect you could change it as well if we wanted at this point if this was two theoretically that should still work fine it's kind of convenient the way the badge is different from the snake that way like even though we turned off the auto reload we can always just kind of like go back through one iteration yeah now where you have only two you can no longer make the l you have to actually eat an apple before we'd be able to make an l now we can we'll just hit the wall there or two perfect okay uh random yes good idea let's do that how do we decide which direction we're going i think that's hard coded somewhere i will put it back to three for now know that it really matters catney has preference you can change it here now or change it to just to show people how easy it is to change your code um stick is better to use i'm sure what you mean stick that to the snake maybe uh random pretty sure there's random in here somewhere yeah and int if we're lucky yeah these are actually zero through three anyway so if we get a random int from zero to three that should work for us oopsy doodles is it just hey whoa okay we don't want four we want three zero and three okay so they're both literal oh we're stuck in the rebel i mean we're not stuck in the rebel we're in the rebel pygamer oh yeah i have to stick on the pygamer i'm with you the joystick yep i do like to joystick yeah i mean the d-pad's not bad but i will say like honestly the pie badge will always have kind of i will always probably have kind of a soft spot for the pie badge or even more specifically like to throw another wrench into this technically what i will always have a soft spot for is the edge badge which is a modified pie badge that has almost the same hardware but one difference is it has a speaker on it and the reason why it has a speaker on it is it's intended to help it run um oh what do they call that tiny machine learning tensorflow light that's it thank you details page here for saving me because i was not going to come up with that this one was made to run tensorflow light but it's pretty much a pie badge and it's pretty much the first circuit python device that i got that i actually like wrote a bunch of stuff for and got super interested in like i would say honestly this device kind of got me involved in circuit python as a project um i got one of these at hackaday super conference in 2019 right before the world went insane and uh for a lot of the beginning of the world going insane i was playing with this thing to keep myself sane um and that is a lot of like why i got involved with circuit python was that device so i will always have a soft spot for it and so in that in that way the pie badge will eke out uh you know better nostalgia for me than the pie gamer but i do really like the pie gamer as well okay so we should be random now oh yeah we started going down that time so i'll just eat one apple and then lose and then we'll restart a few more times just make sure we go different directions oops start microphone yep on the tensor on the edge badge there's got the microphone yep this time we were going left uh worth noting as well just a heads up to you for that edge badge since i was talking about it that tensorflow stuff does not support circuit python if you do want to do the tensorflow specifically as far as i'm aware maybe i'm wrong but i believe it's uh arduino style if you're gonna do that kind of tensorflow stuff and you have to like train your model in the pc or something and then you copy it into there i've only messed with it very very very briefly the actual tensorflow portion of it um and at the time i did it at least it was not in circuit python so heads up this is a circuit python stream but in that particular instance of that thing that's actually more on the arduino side i believe yeah so we're looking good here we're starting different directions each time we did up that last time i didn't mention it but it was going up obviously there what about having the button to having a button restart the game inside the game so you don't have to go through the badge every time oh yeah we could do that so basically maybe at the end so after you lose maybe it just says like start to go back to the badge but then then select for instance or a or b or whatever to just restart the snake game i like that idea that would be in here and so basically that's saying like else if the game is over and then it's saying if the start button gets pressed then supervisor reload we'll say select button instead could be a or b or anything else too though um so we could like we could like recreate all of these things but honestly the restart mechanism is kind of convenient how do you get the uh can't you print the name of the file in python does that work in circuit python uh let's see start should restart the game we can do that switch at the other way around something else could restart the badge um we do like underscore underscore something or or um o s dot path zero no what's args okay sys dot arg v zero is that going to give you the file name okay we actually want to go back we want to start snake and see if it prints out code snake game so we could just hard code the string we might end up doing but index how to range didn't actually work okay um name underscore name equals main but that's like name name of python get name of the script file name of current script underscore file i don't know if that works in circuit python i would test it from the repl but it would probably do something different from the rebel yeah does the snake code work with the pie badge up down left right buttons yes it does yeah it definitely does the way the snake game is written it uses um pie badger dot button which pie badger in addition to helping you do your conference badge stuff also has an abstraction layer for the hardware buttons including the joystick on the pie gamer to turn it into pretending to be like down up left right buttons um so that pie badger library makes it so that the joystick behaves the same as the d-pad oh no no yeah there we go code snake game perfect yeah thank you keith uh file that's what we want and so i was you know i was gonna say like we could just hard code it but this is nice because that means if you happen to save this code snake game as a different name uh this can still work so we'll say let's say start is gonna restart the game and then select is gonna restart the badge so in order to restart the game i think we want to actually just make use of this thing again because this is already really convenient just say set next code file to ourselves and then reload okay and then i saved snake and currently we're at the end just waiting for this so i am going to press start this time but this is the old version of snake so that's going to take us back to the badge we're going to launch this again which is going to be the new version of snake and at the end now the start button should restart snake directly the select button should go back to the badge although we will need to update the screen too because i think the screen's now wrong because we get to there that actually says press start for code pie but that's incorrect if we press start we're hoping it goes back to snake again perfect and then i'll just let it finish and then we if we press select that's gonna get us back to badge perfect press start for play again press start let's say press start to play again let's uh where we don't have very much room you know how well that fits you know it looks sick as like it was in the psp 1000 i never did get a psp press start play again we're almost done i think we don't even really need press honestly right and it would be more aligned vertically like star will be on top of select you don't need we have different parentheses also we don't need that i wish the line height maybe was not so tall let's see what it looks like like this so the good news is actually the the convenient thing is i should be able to press start i think that's gonna give us the new version of snake let's see yeah we have an extra space start play again select badge the wi-fi get going this is a tough one this is where the wall danger comes in right because you have to hit this turn at the end here perfectly otherwise you lose there we go we got it we're still in like super easy mode right now it does get faster too like the higher your score it's harder because your snake is longer but it's also harder because it gets faster like we just had a speed up there which make these turns harder to amra hitched on me okay we'll call it after this one jump up to six nice could you do press any to play again or select to go back to the menu you could yeah good question you could we would if you wanted to do that you would just need to put more of these you could just say else button a button b yeah those are the only other two buttons um but yeah you totally these ones here are just checking for the different buttons so you could have like duplicate this one b i don't know is it just dot a or that part i'm not sure of let's look in codepike is that one we'll have it yeah that guy those are just single letters a whoa we don't we do want this a a reload and then go bb reload and then wait do we want any key to be reload the game or any key to go back to badge any key to go back to badge right yeah start for restart the game any other button to go back to the badge makes sense if we put other sure these match our global's common in circuit python regular python development global uses is typically shunned um i don't know i don't necessarily think i could speak for common in circuit python i will say like personally i do not personally have quite the aversion to globals that it seems like our made best practice not to do with python personally they don't bother me that much um especially in a script like this it's a hundred lines of code it integrates this with this one which is 200 lines of code so it's not nothing you know it's a fair amount of code but it's also not like a gargantuan project um i can still wrap my head around everything inside of this and keep the entire picture in my head to the point where globals i don't feel like i'm gonna get in trouble with them um and then one of the things is like you know sometimes you find stuff that's like best practices says don't use globals well like one of the ways you could avoid using globals is make an object with all these things on it and then just be changing the object but at the end of the day like what really changed in that point right like we made our code a little bit more complex in order to make it like follow this technically best practice thing but like at the end of the day we now we just have properties on an object and we can change those the same way we could change global variables i don't necessarily see one as better than the other and so yeah i don't know i'm probably not the best i'm probably not the best person to to beat the beat the drum of the don't use globals um i don't mind globals too much and i find that sometimes when you rack your brain to make it so you're not using globals you end up using a thing that is functionally the same that py lint or whatever you're checking with just doesn't care about because it says that's okay and maybe it is okay maybe like maybe my judgment is just wrong but to me it feels silly to change like these two function the same it's not really easier to shoot yourself in the foot with one or the other so i don't know i don't really see one as that much better than the other it depends though if it's a huge project um it definitely starts making a lot more sense and you know especially if it has lots of different files which are all kind of keeping their own scopes and all of this kind of different stuff like as it gets more complex that does definitely start to creep in more and more is something that i would look to do in my own code bases but for a relatively basic thing like this i'm pretty much take the approach of do whatever you like and in my case what i like is quickest and easiest to write even if not um strictly following all of the best practices a hundred percent did we change anything else snake help did anything in snake helpers change i will update it just in case it probably maybe it did i don't remember oh i changed badge second actually i'm gonna leave this how it was code badge with wsgi this is actually the one with the new code in it i'm gonna leave code badge the same that's the one with no extras it doesn't have wsgi or mqtt or anything it just does the badge by itself not the web neo pixel stuff badge with wsgi that's going to be the one that does the neo pixels with the web thing specifically with the h2tp server the wsgi version of it okay let me catch up here and then i think i'm wrapping it up for the night um one of the more experienced devs would be better to chime in with globals yeah totally agreed i also for what it's worth i have zero like formal training with python i have let me make sure i'm not lying yeah i have never taken a course to learn python at all everything that i have ever learned about python has just been me discovering it and using it so i definitely don't claim to do anything the correct way and i kind of just forged forged my own path and i am a bit stubborn sometimes so i don't necessarily always change my ways when i should sometimes so that kind of keeps me stuck a bit as well uh most sarge python code uh the bit you write is usually only run on the board and messy global soup is a a lot harder to generate because the scope is bound to what's on the microcontroller reasons you need to avoid reasons you need to avoid globals in general in python is a situation that you don't come across as often yeah on the microcontroller scale uh the guessing it makes the code run faster on the microcontroller because you don't have to pass values around i would assume that's true but i don't actually know for sure the ramifications of global versus not as far as the speed and all that stuff um i would assume it's better on some some level but i actually know it sort of it depends way yeah some reason i assume the micros that work circle python would be a lot closer to pc raspberry pi than arduino learned something tonight thanks yeah for sure thanks for tuning in happy to have you happy to have you around um but yeah i would say you do you are you're on the right track there with what you said the circle python is definitely closer to an arduino more so than a raspberry pi typically they're they're very very small computers as far as computers go um and they do work a lot closer to how an arduino does than a raspberry pi not a full version of linux or anything in there so either a buy everything i know has learned on the job around my own yep catney's saying to you about python training so um okay i updated the latest stuff in the repo um catney you've got the repo if anybody else is interested in checking out this code i'll post this in the chat as well that's the repo where the code i was working on is that uh it's all relatively descriptively named the snake game is in there the snake helpers are in that file the badge the one that we were using is this badge with wsgi that's the one that will host the web server so that you can load this page and set the neopixels um so all that stuff is in there one thing i do still want to do i think you mentioned at one point catney a uh a splash screen some kind of like startup screen or something um i do think that would definitely be really nice to have so i will try to add that in tomorrow as well and i'll ping you when that is in um but otherwise that is going to do it for now we're a little over as far as i normally go but it's cool because we had something fun to work on um i am going to head out now though and go get some dinner i hope everyone who's watching has a good evening um i will catch you next time for folks that are interested in content like this um you can catch me streaming again tomorrow morning if you're interested i'll be working on similar sort of stuff uh tomorrow morning at 10 a.m central time it will be over on my own youtube and my own twitch i'll put links in the discord when i get started uh since the links change from week to week i'll put the links in there um and yeah i'll be back at 10 a.m central we will carry on doing this as well as some other stuff i think i don't think this will take the whole time tomorrow so i will play around with it some more uh but otherwise that's gonna be it for now so long everybody i will see you all