 All right. Hello everyone. Happy Friday. We have made it through another week Let me just shuffle a couple more of these chat windows. Let's line up. I'm centered a little better there How's it going? Luah there in the chat. Thanks for tuning in. Nice to see you and happy Friday Let's go Inmise this one. Let me just make sure I got the other two chats on top Happy Friday. How's it going Tammy? Thanks for tuning in So hello everyone, my name is Tim and I go by foamy guy on github and discord This is the weekly circuit python deep dive stream The stream was originally started of course by circuit python lead developer Scott Shawcroft He has been taken leave for a bit because him and his partner had a new child He is back to working now at least for a few weeks. We got him back But he is taking another leave coming up here in a couple more weeks throughout You know another big chunk from the year So I have been doing the deep dive stream instead of him and I believe for the for the time being that's the plan is for me To keep doing it at least until potentially whenever Scott is back from his next leave and and settled in and You know set to go with with the child and everything that's gonna be a lot of work in a big adjustment in his life I'm sure so whenever he is ready to go to take back over the stream That's when that will happen until then. I am here every week on Fridays at 2 p.m. Pacific And we are diving into the internals of circuit python Some weeks we are actually looking specifically into the court of circuit python like we did last week We worked on the webflow stuff a bit This week we are actually gonna set our submarines a little bit shallower We're you know, we're gonna go up a little bit couple You know a couple of meters if you will In the ocean. We're not gonna go quite as deep today. We're gonna look at more Project level stuff. So like user code, you know writing circuit python code Rather than writing C code, you know inside of circuit python itself. We're gonna work on a project today But I am getting ahead of myself a little bit. So like I mentioned, my name is Tim This is the deep dive program. We're gonna be working on circuit python stuff If you're brand new to all of this though, and you don't know really what I've been talking about Sorry that I didn't do the introduction earlier for one thing, but we have it here circuit python Is what we're working on and this is basically an implementation of python that runs on tiny computers called microcontrollers So I've got a camera right here, which has a circuit python Titano device. This is a circuit python. Pie portal titano. So I'll flip it over here. We can get a better look at it This is basically just a tiny computer, you know, there's a computer inside this main chip here In this one, there is actually also a secondary computer over here that controls the Wi-Fi And this one talks back and forth between the Wi-Fi chip and the main chip But essentially we're writing python code that runs on these little devices here these tiny computers here called microcontrollers There's lots of different shapes and sizes of them. I happen to be using a pie portal today Because it's got a built-in screen and we're gonna do some projects that do stuff on the display But there are lots of other, you know, you know form factors for these devices as well, right? All of the rest of these are also circuit python microcontrollers. These can all run the circuit python Code the same kind of code. We're gonna be writing But obviously, you know, there's lots of different shapes and sizes and you know form factors for the pins Some of them have like edge connectors. Some of them have stemma connectors Some of them have tons of pins. Some of them have, you know, female header pins. Some of them have solder bowl You know pin headers. Some of them have You know the what do they call those little grooves on the edge there? I'm blanking on the name But they have the little grooves on the edge where you can actually solder the outside of it as well So, you know again all kinds of different ones of these things the thing that ties it together is we are writing Python code that runs on them and it's part of the circuit python project is that it's super easy to do this You just plug these devices in they will all have a USB plug you plug it in It shows up as a thumb drive on your device. So like right here. I've got a circuit pi You know essentially just a thumb drive connected to my device inside of there It's gonna have a code.py file and we can just open that code file inside any editor And then write our code inside of there and it will automatically run on the device So that's kind of the 50,000 foot view. We are gonna be getting you know down into the weeds So to speak we're gonna be diving into using circuit python quite a bit So if you're brand new to it a couple of things you can do if you want to get up to speed Head over to our discord first of all which I have down on the screen there ADA FRU IT That's the discord castellated pins. Yeah. Thank you folks in the chat there ADA FRU IT that's the discord if you head there and join us we're in the live broadcast chat room So that's the chat that should be showing on the screen right below me. Yep that chat right down there That's the discord so head there if you're new and you want to get involved another good place to go It's circuit python.org. This is the main page for the project so you can head here and learn more as well Circuit Python is an open-source project. So anybody is allowed to contribute But it is primarily funded by this company ADA FRUIT So ADA FRUIT is a company based out of New York in the United States. They make hardware and software Generally though they sell hardware to the public so you can order hardware off of their website You can buy the microcontrollers You can buy all the things that you know, you can plug in and do with the microcontrollers. So, you know buttons Buttons over here rather and batteries and you know sensors lights like these neopixel lights here leds buzzers beepers switches levers any kind of little electronical widget like that You know you can buy those over on the ADA FRUIT store And if you do it helps those of us out who are working on the project because again ADA FRUIT is paying The folks that are working on the project some folks work on it full-time and are paid by ADA FRUIT to do so Like Scott who I mentioned earlier other folks like me are a part-time You know member of the circuit python team. So we get paid to work on the project part-time including you know contributing code and doing these streams and You know learn guides and other projects and things so again thanks to folks who do purchase hardware from ADA FRUIT Definitely appreciate it from all of us who do work on the project. So let me catch up on the chat here as well So we've got Tami and Lua. How's it going Dexter? Nice to see you Dexter Paul how's it going? Happy Friday from Lisbon see Grover. How's it going near a dock? Thank you again for the castellated pads Like the things on the castle. Oh, yeah castellations on the top there. Yeah Beata how's it going over in the YouTube? Thanks for tuning in Dave Odessa as well and Brett and let's see waha greetings Yeah, castellations we got over there as well. So thanks for that folks Alright, so I think we got the introductions in as I get going here You know, definitely feel free to drop questions or comments or anything like that in the chat. You know, this is a two-way street I'm happy to just have you look over my shoulder and see what I'm working on But also, you know, you can jump in ask questions offer suggestions any of that kind of stuff I'm happy to entertain rabbit holes You know, we can go off on some other tangent for a bit if we want We can kind of work on on what we want here So feel free to shout out in the chat if you have anything you want to say or ask Let's see there good afternoon from Reno, how's it going Sherry? Thanks for tuning in and Amare. Oh boy You be thanks for tuning in there. Nice to have you over on the YouTube So more specifically jumping in today what I'm gonna look at is I'm starting with this learn guide repo poor request so This is a poor request where somebody has Enhanced the code inside one of the learn guides in particular We'll pull up the guide that it is it is this pie portal. Hi portal interface guide right Here this is a guide that I do Reference a lot and do a lot of work in and as some of you may know if you've caught a few of the previous streams We're actually working on building a new version of this all together So that'll be cool once we have it with like a sync IO and some of the newest widgets and things that will make the The code for this a lot You know more concise and understandable and easier to hack and maintain and such So we are working on that not specifically today. That's not what we're gonna do But that is in the works and what we're gonna look at today Though is another person submitted an update to the existing one of these where they have made some improvements to it Not necessarily the full overhaul like we're talking about you know changing to different widgets and Using a sync IO and all of that kind of stuff, but they did make some good improvements. There's some typos and things they fixed They refactored the code a bit To I think remove some duplication where possible and they did a couple cleanup things like that So we're gonna take a look over the PR. We're gonna test it on our pie portal see how it's working And leave a review on this PR So that's where I'm gonna start today and then after that we'll get into the next project Which I will talk about more later on Okay, catch up. Okay. Yeah, we're caught on the chat there So first thing I'm gonna do is just get on this PR on my local branch. So I have the learn guide project open up here So let's see so Adafruit is kind of like the old Edmund scientific out of New Jersey So I will say I don't necessarily know what that is But I am happy to plug it in here see if we can't get a quick idea of what it is And then if so I could probably Answer that a little bit better. So they were based in Barrington. They were founded in 1942 retailer of surplus optical parts like lenses Later branched out into complete systems telescopes microscopes a wide variety of science toys and kits Yeah, that sounds that sounds right up the alley for sure Yeah, the especially like, you know the science toys and kits like definitely a lot of things that Adafruit stocks I would consider science toys and kits the you know the microcontrollers themselves I certainly look at them as toys I play around with them. I am entertained by them the the kits There are kits available on Adafruit where it'll be, you know microcontroller plus a couple of other things in order to make a project There's even sort of the main one of the main product lines at Adafruit is what's called the oh No, I'm drawing a blank on the Eight a box. It's I don't know how I could draw a blank on that, right? But eight a box is a kit that comes out every so often It was quarterly there's issues right now where it's delayed because of part shortages and things like that so it's not quite going quarterly right now, but that's like a reoccurring thing where you know every year or whatever they released this eight a box and it's got You know a kit inside of it. It's got all the parts you need to make a couple of different projects Typically using whatever the newest, you know latest and greatest hardware that Adafruit has created is So lots of stuff like that and again I'd never heard of that company before but it sounds like that is right up the same alley as what Adafruit is Edmunds scientific. I'll have to look into them some more later. That sounds like a pretty interesting place Okay, so we were checking this out. I'm gonna just I have this opened up locally inside pie charm here I'm just gonna use GH so we're gonna go up one GH PR list That's gonna show me a list of them And then the top one here is the one that we're looking for I happen to know that that's the title of it So two one nine nine is the number so we're gonna go GH PR Check out two one nine nine. I hope the chip shortage settles down in 2023 Yeah, definitely. I think a lot of folks probably around here who are watching this are for sure fingers crossed Yeah, hoping on the the chip shortage easing up a bit definitely It's rough. It's rough out there for sure. I Lady-ed it does a great job of like You know going with the flow and figuring out how to change things up and stuff and if you watch them for folks That don't know like Lady-ed the the founder of Adafruit does a lot of the hardware design and on Sunday evening So today's Friday in two days from now You know typically on Sundays, I guess I don't know for certain if she's doing it this week I would assume so but I don't know for sure But Sunday evening and there's not it not exactly a set time But there's another program called the desk of Lady-aida where she will go over sometimes even like doing those hardware designs and the Struggles with the chip shortage and you know making a new redesign in order to account for a fact that some chip is not available Stuff like that so for if folks are interested in that side of the business that side of what goes on Do check out desk of Lady-aida on Sunday Evenings is typically when that's on and you can just follow Adafruit on Twitch or YouTube or you know any socials Twitter or something. I'm sure it gets tweeted there as well. We're also always in the discord Young man use logic to demand you can answer your own question Right now use straight physics only Really sure I follow exactly what you mean If you use logic to demand You if to demand you can answer your own question right now use your straight physics only Yeah, sorry. I'm not sure what you mean on that one Every Sunday yep Lua occasionally there will be a Sunday off if there's if PT and Lady-aida are busy or something like that So sometimes sometimes not but it's it's typically yeah most Sundays it is going on there So we've got our PR checked out We're gonna go find the pie portal interface Folder inside of here. So the learn guide repo is basically a big list of folders Inside each of these folders is one of the projects Which matches up, you know, typically with one learn guide and we're looking for the one I thought it was called pie portal interface I'm not actually seeing it here though. Maybe it's called user interface Instead of just looking through there. What I'll do is go to the code page and then go to Excuse me the bottom here where there's a GitHub link right here This will tell me the folder I put a user interface. It is okay. So we're gonna head on down to the use There we are There's the code for it Okay, so we'll put this on my device in a minute. We'll run it. We'll we'll check it out see how it's working But I'll also take a look over the code in the If here on github, let me also read the comment Let's see what we have spelling rearranged code for readability simplified many operations Maintain the purpose which is you know functionality the examples of all the features They tested on a pie portal. So we'll test it on a pie portal and I have the titanum here as well So we'll throw it on that one also Global constants were placed at the top methods were moved above dynamic code Functions pass in variables rather than using global variables That's nice. I don't know there. There may have been pilot ignores or something so pilot will complain about globals as well I think So that refactor will actually help out there as well. Although. I don't know just pilot get run on these I'm not sure Added some comments to explain why why a value is used and how it works So it looks like a original author is no longer necessarily working or involved in the project anymore Dan did ask to run black and it looks like the end user did it which is who is this left right there? Thanks by the way to left right there. I don't necessarily know that they would be watching this if they are that's awesome Thank you either way though. Thanks to this person for Submitting an improvement to this guide. This is nice to have folks looks like they're a first-time contributor at least to the learn guide system so that's super awesome to see new folks getting involved and so thank you to them for Submitting this improvement not only noticing that it could be improved But also going ahead and making the changes and submitting it as pull requests. That's that's super awesome That's how that's how this whole thing works is community members just like that just like that Submitting improvements. That's exactly how I started as well. So thanks to them Physics would be I was trans transported who transported and the cost of fuel is increased each day Yes Fuel um, so I'm not sure. I mean I understand a little bit more I guess what you're saying, but I'm not sure if that maybe I forgot something that I mentioned I'm not sure what that ties back to with what we were talking about or doing or anything it could be I Don't know. I could be drawing a blank on something. I said earlier. That's the magic of open source. Yeah for sure Yeah, definitely Okay, so to start with we did Move this section of code around so we've got our imports, but it's no longer has Setting up the I2C bus All this stuff first instead. It's got some variables for the file names Which I guess these probably used to be down below. Yep. That's where they were Sound effects. Okay, so we do have a new constants section here. I like that as a as a comment there to separate it all out Let's see like me that wrote basic programs on an Atari 800 home computer back in the early 80s to learn To learn these new fangled languages. Oh Canon old dummy. Excuse me. I missed the first part of that there. Can it old dummy like me? Yeah, totally. I think so. I mean I will say I'm biased, right? I work on the project and I and I spend time trying to make it easy for other folks to pick up One of the things about circuit python though, it's like it's targeted at an audience that is not even necessarily programmers It's targeted at an audience that has no Programming experience so like artists and makers and Children, you know students people who don't necessarily have software development background So like lots of stuff has been made very very easy as easy as it can be If you do have some old programming knowledge Even if you know the basic building blocks programming right loops and functions and variables and you know if statements, right logic You know if you know those basic building blocks of programming Then you already have a huge head start and I think what you'll find is like circuit python is actually a Really really easy thing for you to pick up and do if you grab a device and start playing with it I think you would pick it up pretty quick Even if it's been like a very long time since you've coded or anything like that Python in general is actually pretty easy to pick up and circuit python is a is a nice easy version of Python And the the physical feedback is nice as well, right? Like if you do need a refresher or something getting a refresher on programming where you know You're turning lights on or you're reacting to buttons or something something tactile like that You can really not only see the output of your program But also kind of feel and interact with the output of your program Which is a fascinating thing if you've never had that experience of programming a physical device like that It's it's definitely a nice thing. Could we zoom in and on the code? It's a little hard Yeah, we can we can scrunch this one up a bit. Let me know if that's still too small I can check it up a bit bigger still as well. I think Beata says I've been staring cross-eyed at my own code of late trying to simplify it handy to see what others do Yeah Yeah Yeah, let me know how we are on the size. I can still get still chunk it up a bit So we've got our constants of our files. We got some colors. We've got some XY coordinates of where the Tabs are gonna be they call it styling it looks like a location to me Which I don't necessarily think of as part of the style But I suppose it is even in CSS and stuff helper number for cycling Up to 1 to x that's been taken out. We've got some more Button styling this one is width and height We've taken out the screen set up to keep going with variables So what I'll do in a minute here is I'll probably switch back over to pie charm And I'll take a look at the actual code the finished version of it rather than the the diff here, but I'll take another I'll kind of get a quick skim in over the diff and then we'll switch over I think into Into pie charm that's much better awesome. Yeah, thanks for mentioning it by the way I'm always happy to have folks point out stuff like that. I do want you know this Especially the deep dive, right? This is a two-way street I definitely want Interactive thing and I want folks to be able to see what I'm doing and what I'm working on and stuff I also try to kind of narrate what I'm thinking about as well So that you know folks can actually kind of get a look at at working on some of this stuff So thank you for mentioning that Better but a bit more would be great We can chunk it a little more one other thing I can do actually I don't think I have it in this browser in the other browser. I do typically I think there's gonna be like a Size here. We can actually chunk this one up just a hair as well. Maybe and that will You said also you render the page Okay, so that looks like the end of our variables finally then we do have some functions Which is where we've got helpers set back light. Oh Yeah, yeah, okay, we used to have a brightness issue on the titana. We actually don't have that issue anymore We solved that couple week or two back on on One of the streams. I don't remember if I worked on this one or my Saturday stream Let's see. Hopefully pinches Wally while he's displayed to make it physically larger Yeah, 22 inch monitor looks fine Yeah, I will my size is generally pretty big because I am also I'm on a big It's I'm basically on a TV. It's like a 40 something inch like 45 inch TV or something But but it's like, you know, I don't know seven or eight feet away from me I'm like sitting back a ways from it But I have the font cranked up for that reason typically Because I am kind of on like TVs and I further back instead of monitors Did Monty Python help develop Python? I would say the short answer is no, but the long answer is yeah, kind of I think there's lots of references to Monty Python So like the early developers of the Python language were very I believe into Monty Python So like, you know, you could probably say I don't speak for them Certainly, but I would venture to guess that some of them might say that they were inspired by Monty Python at least in some way because there are like references to Monty Python Scattered throughout like the old, you know, the oldest versions of Python in the documents and things like that Especially in the documentation As I recall it, there was lots of references to that stuff I'm 64 years of age and use a Samsung tablet. Nice watching on a tablet. That's pretty cool Okay, so we had a bunch of display groups, but we're still defining Functions in this version. It is getting a little tough to follow which parts have been cut out Which parts have been added in so I think what I'll do is How far are we here? We're not we still got quite a ways actually. I think I'll finish out the quick skim But we'll mostly get into the High charm to actually get a look at the code that is there now. Sometimes I find it Difficult to keep straight, you know, I know it's highlighted obviously red and greens But like in my mind keeping track of like which things have been removed and which things haven't and all that stuff I find challenging sometimes with this view So we'll switch over and just get a look at what's actually there today and step through it a bit Got a tech text box helper function Turn a formatted string with word wrapping This can actually use a label now. We don't actually have to use pipe or the like this doesn't matter I think internally this one uses the label one Get temperature Only if we have the sensor Okay, so there's the end of our functions. So now we're setting up the light sensor Setting up the I2C bus so that we can get the temperature sensor Theoretically we could swap this to board dot I2C See, you know six one half dozen another doesn't matter too much But I think the you know the standard sort of best practice general way on most devices is board dot I2C As long as it exists the stemma port being the one sort of gotcha where it's usually under a different name if it's the stemma one so I Shouldn't say usually either I don't actually know the breakdown It is sometimes under a different name if you have a stemma there may be somewhere it is actually still the same So that's just initializing the temperature sensor Which looks like doesn't exist on the Titanium or the pints so it sets that to none that way later on it will check this variable And if it's none it will not do anything with it initialize the pipe portal helper library Set the background You know theoretically we don't we could take out Initializing the pipe or portal helper library in this I guess it does Well, so this is initializing the neopixel still Which I think the neopixels probably would get initialized inside here as well. I think you could use them from there Eventually instead of doing this one. Not sure it looks like right now the background is the main thing It's doing with the helper library And the background it would actually be really easy to do without the helper library and I think it would add to This example, which is you know essentially is supposed to be an example of how to do like most of the things you can do how to Build a complex user interface So I might be into switching that we'll have to we'll have to see though if pipe portal Object is used for some other things then maybe it won't make as much sense to try to get rid of it In fact, it might be used for like playing sounds. I think there is a I think it plays an mp3 or a wave or something Maybe that uses the library as well initialize the touchscreen set up the groups Make an icon group add it to the view Load glyphs, so yeah, these used to be declared in line here, but now they're way up in the variables We got a Wando instead of a window nice catch there Indents the text layout I like the clarification comments. That's nice tweak the values It looks like a bit as well. So maybe the text wasn't quite lining up as good as it did before Xbox that's up in the functions now these variables are gonna be all up in the variables now This has been broken out The one per line and a bunch of them have comments on them. So that's nice Like all the colors are the same same thing here start after the width of Perhaps with it could say like a width of a button it could say after the width of the first button I guess all the buttons are the same size though This will be the thing when we do make the new version all these buttons These are the buttons that are at the top like basically acting as tabs In this picture here you can see them these are the buttons at the very top here And one of the things we have when we do rewrite this is we now have a tab layout Which is this exact kind of widget so we'll be able to utilize that instead of Actually having to create three button, you know objects and add them to a view group and do all that stuff You could just we'll make the tab layout. We'll add the other Views to it and then it will just do the buttons for us. We don't have to worry about it Let's see here. I think let me catch up here. I think it might be I think it might be just the QT PI 2040 that's got the labeled ITC buses brought out, but not certain It's the board that threw me for a loop He said it's only one I'm aware of I want to say maybe the feather RP 2040 does Excuse me feather TFT, excuse me, which is actually not it not an RP 2040, but is a ESP 32 s2 That's the one I've been using a lot lately as my like general daily driver I just have it on my desk here and I use it to test stuff out And I'm not a hundred percent positive obviously. I'm not looking at the code for it right now But I think I think I remember that one being You know I to see stemma or maybe stemma I to see as the name of the bus on the board object on that one I'm not a hundred percent sure Some more buttons here Layer visibility. Oh interesting. This has been refactored into a function So it's used to be calling show layer view one and then setting a variable and then printing But now it calls this helper function with hide The main group and I guess the thing to hide although this does say show layer one Oh, I see I see so hide view two hide view three show View one Okay, yeah, yeah our hides were here So we don't basically instead of hide layer show layer now. It's a layer visibility It's one function with the extra argument I don't necessarily have a preference on that one six or one half doesn't have another to me I think this one I guess is nice because You know, it's almost more like just Object visibility you could actually pass a different You know, you could pass a different splash. I guess that's what that's one of the things that makes it more versatile Suppose you could also implement other actions as well if there was something else you would want to do But I don't know it would make sense inside of that name. I guess um I don't think so. Sorry sherry Young man would uh, oh, excuse me. I sorry. I also I misread the question. Excuse me young man. Would I be able to put dolly? dolly two onto this In using pure mathematics to To see what kind of artistry I could see or produce um I'm not familiar with dolly or pure mathematics truthfully is that like a uh Is that like a programming language or some kind of like Yeah, I'm not familiar with what that is or pure mathematics. Is that a um Sort of pure something else before I think Okay, this is just just the concept Yeah, sorry, I'm not I'm not really sure what you mean. You can you you can crunch numbers. There's lots of mathematical Number crunching. So if you've if you're familiar with like num pi in uh in regular python, you know on the pc There is stuff like that. Um For circuit python, there's a thing called u lab or micro lab Um, which implements some of the num pi stuff. So if you're if you're working on mathematics stuff The institute for pure mathematics and applied mathematics. Oh, okay Okay I mean, there's definitely like number crunching stuff that you can do on the devices Um, you know, it depends I guess specifically what you're doing and and where your data comes from and stuff like that Um, I I'm probably not the best person to answer more specifically like any particular one thing with mathematics because I will say like my Um, my background my specialty is more on the software development side and then specifically in circuit python I tend to hang out a lot on display stuff Um, not as much on sort of the lower level number crunching stuff. I've tested a few things here and there Um, but it's not like anything I'm formally trained on or anything Uh ministry of silly walks. That's a good department. I like them Very very important department Their visibility These are just broken out into multiple lines It's like this must have moved somewhere else because longer here or I guess maybe Okay, that'll be one thing to check on is uh, what happened like why is this gone or where did it move to? Maybe it's inside here now Um, basically we'll want to make sure we check like what happens if it doesn't have the ad t Because it used to have this if statement for it, but I don't see it now Will also cause the screen to dim when the hand is blocking the sensor touch screen Okay, setting the backlight according to the light sensor Which is yeah, there's also a light sensor on the device analog. I think light sensor. It just has a You know analog pin value If we're going to be refactoring, I almost would think we should just go ahead and change this either to f strings or uh Without format either one But I do think it's probably worth it to get rid of the percentage, um Substitutioner, I don't know what they call that with the percent s there or whatever it is Percent d. I guess it was actually a number but visable visible. Okay Little formatting here Keep our uh string from bouncing way back Okay, yeah, it's just appending Because if you just smash two strings together, it's like it will plus some rule together there Since this one's using format. So maybe we should uh, maybe if we do change that percent, maybe they should just all use format and we've got down here if If i is six and view live is three What is I I should could I have a better name? What is I? button button pressed Let's each button to see if it was pressed Yeah, this is one of the things to the uh the tab layout I think will make this code a lot nicer because right now it's like looping over every button that exists But like some buttons are the tab Tabs themselves the buttons that switch you between tabs But then other buttons are like visible on all tabs or under the tabs if you want to think of it like that But then also some buttons are actually on the pages themselves. So they're only visible when that tab is Visible like there's a lot of logic, but it's checking like every button every time it could uh It will get simplified from the tab layout because it will handle those buttons Even the rest though, I think uh, it'll be a little bit less Logic like this we we may not need to have as much like Verifying which pages live We could maybe get the live page and then only check the buttons on that page In addition to the ones that are outside the pages But I think that will be a good upgrade when we do get the tab layout in but that's not necessarily anything We need to do for this one. Okay, so we took a look through We've got the code. I did update. I believe right. So I should have this code. Yeah left left right there No tracked branch. That's fine. That's because I did a bh uh gh checkout. Let me uh Catch up here. I'm a student of professor honor Mutlu I've been working on computer architecture and micro computer architecture for the last five years. Thank you, sir Yeah, for sure. Thank you Um, thanks for tuning in. Um, and I guess yeah, thanks for the work you're doing that sounds like Sounds like pretty crazy interesting stuff Um Let me catch up on the discord here as well. Uh every board with a stemma qt port has stemma itc now Oh, okay. It's been updated on all of them. So stemma itc across the board taps versus tabs when tabs create a conflict tabs tabs Not sure which part of the code we were looking at When tabs here maybe tabs Oh, I see. Okay. We have some tabs and we have some tabs Yeah, honestly, I would uh prefer these probably to be button. I think instead of tabs Um, I think what they're going for is like the buttons are tapable So you tap on them when you want to press them, but I think maybe button Might be a better more clear name Especially yeah, I didn't even think of it before but yeah, especially because we're also using tab with a b so it it would be easy to uh accidentally swap and Hype one when you met the other Good catch. I think taps probably button would be better It's either an alias to board i2c or a different port On the qt pies that have both on different pens Uh, we disabled uh pylons f-strings because all boards have them Uh, but that's sometimes a good change. Yeah, but I think pylons does it not complain about percents too or Maybe it doesn't maybe that's part of the f-strings one Um, I thought it preferred like dot format over percent as well Maybe not. What is that? Oh, the ice cream man Ice cream man is here. Is anybody wanting anything? Oh, you got a hurry though. He's going kind of fast. He is not really going too slow Pretty much we missed we missed our opportunity for ice cream. Sorry folks Sounds good though. So my scream does sound pretty good. I'm not gonna lie Ice cream sandwich, maybe cookie sandwich. I'd probably go with the cookie sandwich for me Uh, yeah drop your ice creams if we could have ordered ice creams right now and I could download them to you through discord Let me know which kind of ice cream you would like Think it might complain about the percent Okay, it may also be like the config for learn guide might be different too like pylons I'm not sure if it runs in actions or if it runs. It's the same config. It could be Different for the uh the learn guide thing as well I think I mean most of this is looking good as far as the changes themselves We're gonna test it out. So we're gonna make sure everything is still working. We'll try both devices We'll look into the adt thing because it was odd to me that we didn't have the uh The uh if adt is none basically we didn't have that check anymore. I'm gonna check into that um But you know just generally speaking like most of the stuff I've seen here is has seemed all pretty good to me I like the way it's organized now with variables and then functions um The uh a couple of new helper functions. I think these are nice You know this one. I don't necessarily have a preference one way or another but but I do like it You know, I don't dislike it or anything like that. I think it's good Uh I do like buttons instead of taps. Uh, how how old is this one? Do we want to I guess if if we're if we're not going to change too much what I'll probably do is just add a commit Uh and then approve it and merge it If we have a larger change It's because it's also been a couple of days if I would have got back to this person sooner I might have been more inclined to um Leave the change request, um On the pr, but if it's like if it's gonna be just a minor thing we may just go ahead and change it See what we end up with though That is interesting. We just don't have that. So if we go inside of here, what is it? So it does okay source. Okay. Yeah. Yeah, so it does Oh, I see. Okay. So it's going to use the microcontroller.cpu if it doesn't have the actual sensor Is that what it used to do as well? It just was inside of the if statement and not in the Not broken into a function and just had that right in main is that Okay. Yeah. Yeah. Okay. Yeah, I like that being inside I do like that being inside a function. That's a nice one We could fix this if we wanted to while we're here. This is not actually the case anymore Although that is I will say I don't think well, maybe is that in 731? Not sure if that made it into 731 or not if it did then it would be time to go ahead and remove this probably It could be a separate pr still though um If that change was not in 731 though, if that's not going to hit until eight then I guess we probably would hold off I'll have a 99. Uh, you just became my hero. Thank you. Awesome. Thank you Twist from a truck or mint chocolate trip. Nice twisty one You thinking like fruit twist there two different fruits twisted up or the mint chocolate chip I like mint chocolate chip too. That was my favorite as a kid always And managed to fit f-strings on all boards, but I'm not sure if it's seven three or eight Oh, wow. So like trinkets old school aim zeros. They got room for f-strings in there now, huh? Uh, yeah, warns you about the percents to use f-strings. I don't mean they're new. I got you Uh, they I mean they are for what it's worth. They are relatively new to us in circuit python It's been I mean, it's been a little while now. Maybe a year or so, but Still relatively recent the f-strings. I think that's it may still be one of the differences as well I don't know that micropython has adopted it yet But maybe they did in a newer one Not sure Yeah, even this one has like the same variables, but they call it big button Instead of taps. I think these they could be like small button or just button. I think is is probably fine What we'll do is we'll also take a look at which thing this actually is in the code Because I'm not a hundred percent certain. I think it's going to be the the the views at the top Which confusingly enough are actually tabs. At least that's what I think of them as If they are maybe we call them tab button y and tab button height With maybe we call them that if that's what they are So we're going to take the code. We're going to put it on our device. Um, so just like I Showed you earlier. We got a thumb drive. We're just going to save our code on it. First. I'm going to take a look at what's here This is uh, I'm going to keep this. This is a test for Uh pr that I made in the core for fixing Pal palette functions when you pass in Indexes that are out of the range So palettes have a range. It used to not check the range It used to do unpredictable sometimes bad stuff when you gave it a number outside the range Now it raises an error message and this is a script that tests that Index bounds test Thank you to I think it was seagrover who was here in the chat at least a little while ago Thank you to seagrover. I think is who made that issue about the palette bounds. Thank you for finding that Only a good improvement. Definitely That's the kind of stuff that we do always want to clean up and that's perfect for me because that's the kind of stuff that like I It's right on my level of current Skills with circuit python is being able to fix stuff like that And I learned some new stuff as well this time around when I was fixing that I learned about q-strings And how they work and how they get generated automatically Um, which is actually pretty fascinating the way that q-strings work inside of circuit python core but I had a chance to learn about that And Also some of the validation functions which are built into circuit python core. There's a lot of like mpr validate Something like validated is the the kind of thing the type of thing you're expecting or that it is a number or that it is within a certain range Uh, I took a look over a bunch of those and I was inspired while I was working on that That pr so let's get back to our camera here And we are running it. I'm on the titano right now. So one thing is uh, You know the background doesn't fit all the way Um, and that's fine. That's just because the background this particular image was made to fit the uh Pyportal standard rather than the pyportal titano one thing I guess we could potentially do is uh, bitmap blit No, no, no not blit. Um, roto zoom the the thing we were using last week from bitmap tools roto zoom We could maybe roto zoom this to be bigger But I think it's it's probably on this bitmap right now Which means it's not in memory Which means if we did want to roto zoom it we'd have to load it into memory And it's probably would take up a good chunk of it because it is a big picture Um Let me see the light will probably make this a little better, but I don't know if we're gonna be able to handle the glare Let's see what we get. Whoops Brucks here have three spigots chocolate vanilla and twist. Oh, wow. So it's like a soft serve thing on the truck That's pretty cool like mobile soft serve That'd be awesome. Usually here. It's like packages of stuff. It'll be like, uh You the same kind of stuff you can buy like a box of at the grocery store But they'll sell you one at the truck. So it's like an individual sandwich or an individual bar with ice cream in it Stuff like that The titano is a challenge on this, uh because of the glare I'll just go back to no, uh No led Actually, I need to figure out a better way better camera just a better setup for this stuff to, uh To get it in here pull it in but it'll work for now So I mean functionality wise everything seems to be working fine I'm able to switch between the views Yeah, this text got wrapped, uh, we could go on here. This turns on the led on the back. You can see it lit up back here We could change light color. This will turn on the led and set it to a certain color. This one is now on yellow And now it's on green blue pink red yellow That's the cycle we got there and we can always go back to off. You know, so always go back to on with white So that's working This one says tap the icon to meet my friend meet a new friend tap icon We pressed it and now we see uh, is that Gus the green led They hide a gust we press it again Now it is billy the blue led to say hi to billy But again, and now we got ruby the red led. So you say hi to ruby Tap it again, and now we're back around to Gus. So that cycles through those Appreciate your fix. Yeah, you're welcome for sure Uh, sometimes just dropping the display brightness to point one works. Oh, that's a good point Yeah, I think you have given me that hint before actually, uh, thank you again. Let me uh Right now we do actually what is this zero and one? Calling this why do we have this? All right, it's got it. Okay, so it's doing full on the, uh Titano point three on the standard And because our titano is actually fixed now well my titano is fixed because i'm running like something super new build um We should be able to do point one and it should work I think Or not maybe my build is not as super new as I thought Oh Or maybe I just didn't give it long enough No, I'm leaning towards maybe my build is not as super new as I thought I mean that should be in that was a little while back. What would I have made this course? I don't even know what's actually on my device Look at the old boot out here You know, so that's a build from something it's a build from main or something Just yesterday I was using that for palette index I could have swear we had that fixed now That one not merged or I just not giving it long enough Didn't take that long Oh, okay. I can see it. I can see it up Oh, but you could see it here too. I think it just takes a minute to load I don't load it before It does look a little better. Yeah, and if we go here So here I'll say it's very difficult for me to see looking directly at it Even if I tilt it up. It's a bit dim, but through the camera. Actually, that's really nice That's perfect. Actually. Yeah, all the text comes through. That's awesome. Yeah, thank you Uh, see go by the way Perhaps o3 there might be some differences from board to board. So I was just dropping. Yeah I think one is gonna work. I think maybe I just got impatient. I didn't go I went too quick maybe Because it does go to blank like it is actually blank during some portion Of the loading Then it starts the splash is the first thing you see this thing. Yep And then this which is on this bitmap rendering That's actually our brightness just dropped right there So that must be when we actually called this And there's our render and yeah everything is still looking good In fact, two might have been nice nicer even Leave it here for now. The colors do look better on three though. I will say And then what's on our third one here? So this third page this has got, um The light from the light sensor which is down here So if I cover it up with my finger like that now the light value there, maybe it may be a little smaller And I can't I can only zoom it into about like that But right now it says 1400 1500 somewhere in that range and if I take my finger off of there now It's all the way up to like 56 5700 From the ambient light and then our temperature there right now. That's reading 86 degrees Fahrenheit And this is a titano. So that would be the cpu temp, which does tend to run a little hotter than the room is You know, unless you have a nice heat sink or something like that on it They sell those too, but usually on tricycles But for soft serves you need a truck so they have sundaes bananas. Oh a banana split sounds so yummy Or banana boats parfaits and of course cones. Yeah cones are my jam too. I'm a cone I'm a cone in the cup person I like to get my cone put it on top and then like break it up with the Break it up with the spoon and eat like small chunks of it throughout the ice cream I don't have to go get some ice cream tonight. We'll see After my wife when she gets back Okay, we'll leave that for now Um Functionality wise everything is looking good to me. Honestly. I think really the only I think the only two I mean the percent sign. Do we want to change it? How many places? two places Three three places three or two view on what view? button pressed Those two are not The two places where's two places where we have percent substitution and then There are this there is this variable name, which I think could maybe be button or tab button or something one thing we should still do though is like We want the three buttons across the top of the screen. Yeah, I guess these have to be the three buttons across the top and because it is also screen width I think let's go ahead. We can make a quick commit with those. Those are Not really functional changes, you know, they don't change the way any of this behaves really, right? We're just updating the string concatenation and The name of the variable which is kind of in line with the spirit of this pr anyway Um, if I had gotten back to this person sooner, I might have been inclined to do like a change request and have them Do it but for the sake of like just getting it all in in you know at one time I think I'll make those minor changes and then As long as they selected to allow Contributors to commit then we'll be able to commit it and it will just automatically show up in the pr right away Um, and then we can leave a review on it one thing is though in order to do that I do have to check this out differently. What I actually need to do is Go to any other branch. We just have to not be on this one So I'll choose the main branch even though I have a bunch of others Then we need to delete the branch we were on which was Light tree no light light right that left excuse me left right there main We delete this branch locally for me. I'm deleting it on my computer only And now instead of ghpr check out what we need to do is add the remote for Left right there so get remote Dash v We need to add a new one of these get remote add left right there space paced Get rid of the too much space change from the guy Left right there Get remote dash v. Let's check it get fetch left right there Now we should be able to check out directly that branch as like an actual tracked branch instead of The way we had it before which is Not an actual tracked branch. I don't really know what it is, but it's not tracked I cannot use my Rollbar, thank you. Oh no, they're not listed. I need to refresh the thing I might have a couple of branches in this repo might be time to clean up my branches Sometimes when that menu does an update here's what we do is just go Also still getting used to the new pie charm and this thing has moved update no File where there used to be a thing in here called um Refresh file status Something like that Is that gone? Gonna be in here now. Okay. It is in there now Apparently you just have to look for it and then as long as you look for it it will happen Magic so let's go here. What branch was it? Left right there main. Okay Back. Oh, I can search actually I don't use search in here enough. Honestly. I looked through this huge list I don't I don't even know if I knew there was a search here. I'm not sure I've ever used that before It is super duper convenient though Um, let me catch up on the chat here Uh, when changing product projects from the learn guide How do you keep the article text and code snippets in sync with the full code? Here's a very specific example Would this pr require the article text to be updated? Uh, do they just gradually diverge something else? So Yeah, the short answer is we try to keep them in sync. So When the pr gets merged the article pages should get changed at the same time I'm not going to say that there will never ever be a case where that Didn't happen, you know, like there could be a case where The code changed and somebody didn't realize that the page needed to change as well um But in general like plan a is whenever this code changes if it is also referenced in the text of the article That should change at the same time um, so the folks who do Monitor the learn guide repo and do the reviews on it, you know know about that They know what's up. They know to look for that kind of stuff um And then I will say also. Thank you for pointing me to that because I will update it If we end up merging this we'll update it at the same time So then that way folks will get a chance to see that process as well. So that'll be kind of cool Um, so yeah, thank you Dan J. Uh, good question. They're in the chat appreciate it Both the question and the heads up about it Um, so we're now on the branch we're gonna go For sure. Yeah, you're welcome. Thank you We will I think let's do the let's do the percents. We'll just I think let's swap them to to format for now instead of F strings Because that's like a oh, but it and then the one other part. I guess is this is Well, does that change the functionality though the percent D because it's Is there a different one for D? I'm most used to doing s Percent s We'll go to repel. So this is a serial connection to my microcontroller I could go to the repel and I can just run circuit python code one line at a time So I want to go like num equals. I think this is going to be a decimal. Maybe 10 dot 143 whatever print percent D percent D percent num That prints 10 Closing print C. Okay. So that does do the whole thing So we need something we do need something in here. Is it like is it like that? Let's see string format decimal okay Or maybe string format percent D I don't even it's like took away my search altogether. Uh, let's see on the youtube chat there I'm screaming a cup with bits of cone on top is a sundae I'm having a cone off a truck. It means, uh, it means I'm walking so dishes are currently hassle I got you dishes and cutlery. It's in a bowl and a cup. I'm probably at home. Yeah I'm just I'm always going for the cup even if I'm walking. I'll go for a cup personally I'm always so afraid of like just dropping the ice cream or like at falling out of the cone or a dripping down or anything I'm like super paranoid about that probably to the like, you know, probably to an extreme even I'm always I'm always getting the cup Uh format price equals percent. Okay, so we could do like dot zero f. Would that be Dot zero f Or the name whoa Wait a minute. You can do dot format with names I had no idea that you could use keyword argument names inside dot format like that. I thought it was always, uh Just based on the count I guess right the index named a number of substitutions That's crazy Love the factory ola from uh stormy colorado today. You know, it was super stormy here this morning I wonder if it was move in west Um, because yeah, it was like insanely gloomy when I woke up this morning Um, like normally the sun is out at this time of day like when I start working and like the sun was technically out But it was so gloomy that it still looked like it was night out. It was crazy this morning Uh, and you can use a dictionary as the other argument. Oh, okay instead of like num equals it could actually be uh It could be a dictionary We've had misunderstood how to do it and you can use dictionary as the other argument Not sure which other argument I guess kind of necessary for localization Very useful for translating two languages that use different grammar than English and have things in a different order Plus reordering the arguments in the template string Oh, okay. Yeah, that does make sense Being able to reorder. Yeah, there is like Once the verb will be at the beginning or the end or something different like that I hadn't thought about that, but that's a good point All right, so this one ended up being the one we want though. So we can go We had uh, well, we won't use num. We'll use like view number I think view number or view index move it their numbers because I think it's Are they one two and three or are they zero one and two If they're zero one and two, I think we call it view index if they are One two and three. I think we call it view num as the variable inside the substitution star star dictionary name So it can't be necessarily a literal inline it has to be like define a dictionary and then And then pass it in I gotcha or maybe it can be literal I guess maybe you can just put star star in front of the dictionary I mean at that point it's it's the same as doing it as the other argument But really the power there is like you would have a dictionary already created with a bunch of stuff in it Then that's the dictionary that you want to pass Whereas here we've just got the one and so it it doesn't uh Make that much of a difference either way. Where's our let's go to the camera What are we actually printing here view two? It'll be one two and three Yeah, and they're even labeled one two and three. So yeah view num. I think will be perfect Oh, uh, let's update it here as well and just make sure I haven't broken anything Also, why was it yellow it's because we Not we have broken something in fact thank you, uh I don't know pie charm code watching Ghost that tells me when I have errors in my code Appreciate you Okay stars on the literal may work I like soft serve my ice cream at the golden corral Uh, place some of their fudge in the bottom of the bowl Start the soft serve ice cream and then hot fudge on top. Nice. That sounds pretty good Got a couple of good ice cream places around me Only a sucker for a good ice cream for sure View two on so that's printing the same thing looks good. So let's find the other percent Was button pressed and it's I so on this one we can just go I mean this one I think I will not Be a float probably it should just already be an integer. I think so I could probably just do this way. I think Get a code Well, that's because they're basically the same file I mean, you know That's kind of a copy of the other one Oh, that's a different window then I have to call it a day now. Thanks Tim. Good night all. Yep. Thanks Dave. Thanks for hanging out. Good night I hope you have a nice night nice weekend and all of that stuff. So yep. Thanks for thanks for hanging out a bit You three on good there button two button zero button one Looking all good here button two looks the same as it did Or me and are writing it for the first time. I might like a space between those but It's not it wasn't that way before and it's not me writing it for the first time I can see the case for just matching what was there as well So that's our percents. And then yeah, let's just do taps Also, I did this in here. I'll need to go back to here for the next so taps Did it get renamed? Ready to go. Were we looking at me now? I'm confused Am I on the right branch? Oh, wait, no Left right there main. We're not have taps I think we move these up to the variables, right? Oh screen width I see Honestly, we don't need to do this either. You can actually just do display dot width and height I think we'll save that like I don't know that that's it's still not going to be a functional change It's still going to function the same But it's a it is a little bit more of a functional change than the stuff we've done so far I think so I will leave that one for future pr But yeah, this could be simplified further because we don't even need these in fact wherever these are referenced Wherever these get used somewhere down here Instead of screen height, it could actually just be display dot height And as long as we have display on a variable Which we do Then it will have the correct value no matter which device you're on it will always have the right value on all the devices Which then removes the need to even create these variables altogether It does make sense though that these that that these variables are down here because they I Mean the width I guess the height and the why maybe not as you know They don't need to be down here, but then it does kind of make sense to put them all together So I see that as well But the rest of these ones need the screen size essentially they're all relative to the screen size and the screen doesn't get You know looked up or set up if you want to think of it that way We don't do the screen stuff until down here So if we wanted to move these variables up, we would also need to move the display stuff up And right now at least we would need to move the screen width and screen height variables But we could we wanted to refactor further we could just cut those out And then we wouldn't need them and then as long as the display was above Our other variables, so yeah, I think we'll just keep them where they're at but we will go and f6 shift f6 we'll call this I think um Have button y have button height Factor and now let's look where these are used The fact Or was that not used before are any of these used now i'm confused It's not used These ones are I guess y is default. Oh, well y is default, but also it is hard coding zero So again, like if we were going to do a further refactor we could just get rid of this Or really I think what would honestly be better than getting rid of it is like this one down here should not be hard code zero instead should be Have button width. I think just to keep them as non-functional changes though. I am gonna just rename them um But then we can still make a pr after this that would Do a bit more refactoring if we want and then also certainly while we are writing the new one These are all great things that I'll keep in mind to um You know make that way the first time in this case In fact, it will get managed by the tab layout anyway. So some of that stuff will actually become easier Respect rotation. Yeah, that's true Yep. Oh, there was question. Yep. Does it uh Yep Yep, seagrabbers 100 right they will if you rotate 90 degrees and then you ask for the width you'll get the The short side, you know if you're on a standard landscape screen, which is what the pie portal is Yeah display height and width are awesome. I use those all the time for positioning stuff Like if you want to position something on the right edge of the display or You know centered in the middle of the display that kind of stuff like height and width uh on the display They allow you to do that that arithmetic very easily You know like divide by two to get the middle and Minus the width in order to get like the right edge or whatever Did it before use taps y But like in the currently released one It has a taps y but does it use it? Why do I have this? I have my earbud in but I have no There's nothing playing in there. I don't know why I have this No, yeah, how did it just doesn't use it? So let's make sure everything works And I don't think the sounds come through but like as I click different things. It's making sounds here I'll hold it up to the microphone Come through better. Let me try not to knock everything off my desk here I've got a couple little beeps and then it's got this one. I actually don't know what this one does It doesn't seem to play anything. I may be missing the file for it That's one thing we should check on as well is make sure Sound button press make sure whatever is causing that is actually my fault probably just me missing the file But let's double check I put a play file sound demo on that wave Actually, I have sound wave Maybe it's very quiet I'm gonna hold it up to my ear speaker. Also, let me turn this off There we go Beaker's on the back here somewhere. There it is. Okay. Okay. I heard it that time. I'll see I think maybe it came through there probably pretty quiet, but That's the sound button so that is working I think it was just quiet enough. I didn't hear it the first time Kind of blends in there's also a lawnmower or something going outside here Excuse me One moment. Okay As you can probably guess I uh choked on my water there a bit We're getting back. We're almost better now Excuse me. Sorry one more time Okay, how's it going buddy got my little furry friend stripey dude is here now or if he's gonna be uh Wanted to bite my legs underneath here. Please don't bite me, buddy Yeah, give him give him some Text pets here for a minute so we can hopefully get on this good side Dang it's like making my nose water a bit the uh choking on that there. Okay Thank you. Yeah, I love the factory appreciate it Okay, I think everything is looking good. We're gonna copy this we can bring it over into this one Which is in the repo we can save it. We can take a look at the actual changes we made Just make sure we actually change the stuff we meant to Excuse me. So tab but tab with a b button y Tab button height tab button width We're looking good there There's our new values for these and these and these And then our other two changes are the prints so this one Had the percent formatting we did Got zero f This one had percent d and we just did brackets by themselves And I'll just double check one more time in the last printout. I believe we were printing good both of those There's our button stuff and I'll just click to a new view here view two Yeah, there we go view two on so those are both printing fine We will uh There are pre-commit now there is a pilot rc and there's a pilot shell Does this get called by the actions? I think what we'll do is just run pilot directly. So let's go inside of here 24 consider using width I think the real thing to do is just get rid of the six and seven compatible Then we won't be opening the file then it won't be complaining about width width Not width no d in there Also for what it's worth. This is not even a case where we can use width width So what pilot wants us to do is basically with open file name rb as Image file it wants us to do this instead of this first line here And then like put this stuff inside The problem with that though is that This is inside of a function called set image. So this is a helper function. You pass it the group you pass it a file name It sets the image By creating an on disk bitmap and putting it in the group that you gave it Um And width like this it will open the file it will put it in this variable But as soon as you leave this context as soon as you are no longer indented in so like right here This print statement is not indented. It's not inside the width This file is now closed as soon as you leave that scope Once you execute the last line that's inside of it Then you go outside This file gets closed the problem with that is that when you show an on disk bitmap on the display The file has to remain open or else you can't show it Um So if you were to use width right here as soon as you get to the end of this and we bounce back out of here This file gets closed. We will no longer be able to see Image on the display even though we're going to add it to the group like this We won't see it. Uh, it won't be visible since the file is closed um So in this case, it's actually we can't do it and and because this is inside of a function like No matter what this function needs to return when it's done like This function can't contain the whole rest of the code so and and when this function returns The image file still needs to be open. Otherwise, we won't be able to show it so like it it can't really contain a width because The width will always have to close before the function closes But we need the file to be open When the function does actually end Otherwise, we won't be able to see it. I wonder though. Why did we get that? I guess does it not? Does it not do a pilot? In actions or something It is weird that we got that but it wasn't uh I don't think it was failing actions. Was it? No, it was passing. Maybe it doesn't do pilot Yep, more water is the solution as long as you do it correctly the second time If you just choke on it again, then it doesn't help solve anything but You get it down correctly the second time. It'll help you out one Another thing we could do maybe is run black I bet you I did that control s thing Sometimes I accidentally press control s meaning to save this file But I do it in here in the terminal and it gets in this weird broken state Somebody one day told me how to fix that state That no No Or now I'm just going to close this and make a new one I can't rearrange him Unchanged I'm going to leave that as well because I intend to make a sweep through The entire repo and change all of these basically remove the uh 6 and 7 compatible And just leave us with the 7 plus compatible Since we have a 7 stable release. In fact, we've had a couple we're on 7 3 1 now Control q Try that one control q next time. I'll try it Got it in both places control q. Okay Better remember that Okay, while that is running The actions and such um what I will do is switch over to my standard pi portal Instead of the titano Uh with these things again my favorite thing about youtube chat in the entire world Okay, there we are The irony. Yep Uh That threw me off again. What is I? Okay, we're waiting on this. We're gonna load the pi portal. I was getting the usb cable. That's what we were doing usb cable carefully Okay, it's actually fed up through here. I see Okay Our portal's baby sister or a pi portal titano's baby sister, I guess Our portal regular or is the titan of the big sister? I guess if it's a big sister then that's that's still baby sister Although pint would be the smallest one. I guess so this one's the middle sibling. I suppose Um No idea what we have on that 7 3 0 we might as well. Let's throw because there was a release the other day, right? Let's throw the new release, right? We might as well do that. That one's there ANSI terminal flow control control s for stop control q for resume. Okay Flow control That is ringing a bell. I do think somebody Somebody did tell me that one before so we'll Little tap Reset to go to bootloader It's really one meg. That doesn't seem quite right, but I bet you it was just giving me a weird You know my downloads again 1.1 megs Is that right? I feel like I was used to those being a couple of megs Save more space. Yeah current is 2.1 Control g rings a bell Eight alpha is also the one meg. Maybe we just maybe that's the space like why F strings can fit now. I guess maybe that's part of the space is Making these things smaller Yeah, because that's 1.1 as well. What was 7 3 0 this will be easier on s3 Well, maybe it wouldn't I don't know We'll go English. So it's the same No, that one's 1.02. I don't know I don't know. I was just thinking Maybe just the pi portal are smaller than I was thinking Yeah Don't remember about the same All right, we do have it connected now though It did its thing while I was looking at that it reconnected. It's running. We're boot out now 7 3 1 Unix terminal flow control keystrokes. Yep, thank you Charles over there in the youtube chat appreciate it Uh, so we're good here. We got code Here, what is in this brightness testing stuff? I think this was just verifying the uh Brightness initialization of the display back when I was working on it. I don't think we need I don't think I need this code on my pi portal specifically anymore, but Sometimes I keep code that I don't think I need so we are gonna keep it Let's grab our code pi from here We are on Portraits we're gonna want to go landscape Oh, you know what I'm surprised. Hold on. Why did we not have the change for brightness? Didn't I change that or I end up copying it back or something Oh, yeah, no, it must have been changed back On 1.0 now, so it'll be on the brightest setting again. Oh Code done running don't have the bitmap loading Looks like we don't have sounds either, which will be the next thing it needs I'll just grab them from the project bundle. I think I'm sure I have this before Yeah, three. I have three copies of this now. Well, this is the fourth one So we'll take the assets out of this bundle, but of course use the code from The pr and I don't need lib. I should have everything Not we can add them Whatever we need You could skip it if it's already there There we go. So this one fits the screen says that bitmap is like perfectly sized for the screen Same thing for the text here. That's why the text on the on the titano is like kind of occupying like, you know, two-thirds or whatever It wasn't quite the full width more like this one where it's It kind of fits into this box That is another one though the function that does the wrapping There is one that takes pixels. So we could actually just like Tell it the screen width and it could wrap inside of that And I don't hear sounds, but I believe I cut the Trace let me turn this off Yeah This trace right here. There's two little pads right here And there was a teeny tiny little trace between them But I have cut it out with an Xacto knife. This Connects the onboard speaker The other option is to use a plug-in speaker that plugs into this plug right here I don't happen to have a speaker plugged in right now, but I did cut that trace So I'm not hearing the sounds play and that's why But everything else appears to be Working and we did hear the sounds play on the titano And if I would go grab a speaker and plug it in we could hear them here as well I don't think we necessarily need to yeah, you can see this one the pi portal standard Um has a actual temperature sensor instead of using the cpu temperature So this one is actually a couple of degrees cooler here down on 81 Which I think the other one was like up on 85 or 86 Um just because that cpu is running a little hotter than the room Or is like generating its own heat that it's sensing right? Um, so we're looking good there did we Pass actions and stuff Am likely I need that one. Okay refresh Zoom this out just a hair that looks like we passed We did look into the 80t thing we figured out why it doesn't have that if statement anymore. It's actually it does still have it it's just inside of The helper function now Let's give it kind of one more once over and think if there's anything else that we Don't want to keep how it is now I think we're pretty good though TFT backlight Generates quite a bit of heat on the pi portal. Ah, that's a good point. Yeah, the light as well. Yeah Which the temperature sensor probably gets a little bit of influence from that as well the backlight, but the cpu I think is even Actually getting more influenced by that By the rest of the heat the board generates Here's where a couple of the values did get tweaked on for like exactly where it does Show on the screen Not too much though, right like, you know one more pixel x and 20 more pixels y Still just a tiny bit, but Yeah We'll approve this. I will get ready to merge it. I'll go pull up the learn guide as well and we'll change that at the same time Okay, uh and somebody earlier Kind enough to link me to this dan j. Thank you for bringing this up asking the question and dropping the link for the place in this instance where This will change so here we have head layer and show layer Instead this will now be the um layer visibility And it's got a couple of arguments Honestly, why don't we take a quick stroll through the rest of this guide as well and see if there is anything else that might need to change any other code that is uh Taken from the code, but not like embedded right like if it's embedded from github then it will just get pulled in with the newest version But if it's um, you know just written like inline in a sentence or something then it won't um It won't update automatically so anything like that. That's what we'll need to to go ahead and change There's our rotation There is this set backlight function is that I think it's the same still it's just in a new location This one's kind of like an independent snippet Kind of has all the stuff you need to just initialize the display Change rotation you would actually need while true in here truthfully though. I think right otherwise it would uh Just kick you back to the serial afterwards But I do think in this context it's okay to keep set backlight with it Maybe I mean this is really though about the rotation. I guess right honestly we could Brightness has its own section Yeah, we could honestly just cut Cut this function out here, right like it's not really dealing with the rotation at all anyway This stuff here is more so In the touchscreen stuff as well It's calling set backlight I guess but we could Remove that I mean it looks like it was probably copy pasted from some portion of the code piped Oh, I'm not logged in here. All right. We actually will have to use uh Hopefully I'm gonna be logged in on this one. Okay. That's gonna take me a second to log in here one second. Um I'm gonna pass right off the top of my head two factor Are you at two factor I have it on this phone I guess One thing I still haven't pulled over to the new phone maybe Do that Okay Just copy Bedtime here. Thanks Tim. Uh nice weekend all yep. Thanks Paul and to ship it as well. Good night. Thanks for hanging out folks Appreciate y'all. Uh, so here we are Actually go to edit now Page where we on display. So I guess we yeah, we copied the url. So we'll be on the same display or I mean the same page Rather, so we do have rotation section. We have the backlight section, which is where this function will actually be I think makes sense rotating the touch screen here We don't necessarily need Backlight we can get rid of it that'll save us from ever having to update it if the backlight portion does change Since it's not really relevant in this specific example Okay, finding groups I think x is default zero. You might be able to just pass y. I'm not sure popping groups Moving objects hidden Property hide and showing groups. But here's the new one I wonder what the sleep is here for I didn't catch that the first time through. I mean, it's such a small sleep It wouldn't really do much of anything in most cases Come back what I miss Depends when you left I suppose We we left the approval We waited on actions. We loaded it on my pi portal. I got my pi portal standard pulled out so we had the The bigger sister the the titano running earlier with a slightly bigger screen there We're back into the regular one. Everything was still working good We are updating the learn guide now so that when we merge the PR to update the code the guide stuff will match it So that's kind of where we're where we're at But the visibility of a layer so you either put show or hide You give it the layer Which is the group And then you give it the target, which is the actual thing that's either Showing or hiding. You know one thing is it's it's a little odd that they Like here this explains hidden the boolean But then for hiding and showing a group they don't they choose not to use it instead They just remove or add to the group It should almost just be like remove from group or remove from layer add to layer and then now it's One function, but So I think what we'll do is in the code we'll put the function and then we'll also put the uh An example of it being called which right now it doesn't show it being called But because now it has You know two different like you call it and you give it an argument with a different thing, right? Well, I think I'll get one hide and one show I'm unsure about the sleep. I don't think it would have hurt anything But I don't quite understand it Okay, I guess it had it was there anyway, truthfully though, so My guess is honestly this was probably to account for something in like one of the earliest versions of display Oh, and it might not be necessary anymore It probably caused something to work back then that has since been fixed a different way Honestly, that's probably that's my like That's my guess I think This one will need to get updated when we do switch to the circuit python 7 on this bitmap We'll keep that in mind I didn't do it in this uh in this request, but Do we still have a set image function? This will be another one when it when we do update the uh circuit python 7 version Update to the circuit python 7 version 7 plus we'll uh, we'll need to update here as well stocks box links latex library We're wrapping. Oh, no, that's not true anymore I'll just say we can we'll start right there because label does support it itself. In fact, I think pyportal wrap nicely I believe it it may even be calling label wrap text Not a hundred percent certain but definitely we do have it on label now though You can use it directly. You don't need the pyportal library. So you can do it on non Pyportal devices as well, which is nice I have some older projects with a delay after show, but I haven't needed a delay in more recent ones I should update the older code now. Yeah Yeah, and I think this pyportal project in particular like this one. I think it's very old I think this was probably one of the first like display i o examples And display i o has come a long way since then like there's been a couple of major revisions for the way things work and it's been updated a few times over the years but Getting to be uh getting to be more and more stuff like that where it's like the old way the new way I think one thing uh Another thing I should say that I'll do when I do rewrite this is I think I'll try to do the text wrapping without Pyportal library. I'll try to do everything I think without the Pyportal library that way folks can see the way to like Do it, you know manually quote-unquote like without the uh the bigger helper library Honestly, it's not going to be that much code though like uh because label supports it now It's basically just swapping pyportal wrap nicely for label dot wrap text or something. It's going to be super easy Yeah, the sound playing Will be a little bit more There is a nice like one liner pyportal dot play sound or something We won't have we'll make a little helper function for it, but Those will be the only two changes. I think we'll be able to not import the pyportal library Which should save a bit of RAM as well and kind of like to show people the Manual way of doing things right which is kind of the point of the project Oh, yeah, interesting. This is even telling you about text about label string format But then they did have percents in there still nice This is a good primer on like the actual math if you You know you saw the laying out of display, but here's actually a couple that did All right, those are down a bit because of the screen stuff This got expanded a bit button view one button view two button view three button switch Okay, yeah, we do have these button two this one should have a better name You're gonna rename that one when we do a bigger refactor. That'll be another thing to do. I think It is the color button. I think right bottom right This is calling buttons dot append And for being buttons. Okay, so we basically want all of the button icon is afterwards though Doesn't even show it in this one though. Okay, it's talking about the icon button here In fact, yeah, here's the code for it Not by me again. Note that these buttons were added to their display group using dot group This is because a button is a group of other objects I don't think that's the case anymore. I think button. I think it used to have here. It would have said like View to dot append button icon and then this would be like dot group here I think this is the old old The old api though. I don't think it's like that anymore. I'm not gonna fool me today Might be the first day that it didn't fool me, but Well, didn't fool me Yeah, you still have to say dot group to append it, but you don't anymore And it's already fixed in the code. So that part was already actually updated But this bit down here that part's not true. I mean a button is still A group of objects. I guess it's not untrue, but It you don't need to access it that way anymore, right? Like you just call append and you pass it the button It is still a group. It does still have multiple objects Just not how you you don't have to access it By dot group anymore because it is a group not it has a group That's kind of the difference, right? Like when it has a property called group It has a group But when it extends group it is a group and we're that is the group that we're appending It's kind of the way I think about it at least And the spit didn't change. So I think we're good there All right, we do have these so I'll swap that out for the new show hide layers They did show three hide one and two. So I'll keep it the same. I think Go Three hide one and two Okay Slowly but surely getting there There was quite a bit to change. So thanks again, by the way, um, is it Dan? I think maybe whoever that was thank you again for Mentioning this and pointing out the the page We do still have set image We do still have text box We still have switch for you That's another bit of the code when we do switch it to tab layout the newer version It won't need a switch view. There is actually a view on tab layout just like Change to tab one change tab two change tab three whatever We don't have to write that code yourself in the new version And this one has the embed. So this page will just get updated when we merge And then this page is also an embed actually an embed from a different project interesting That's kind of a random thing to add on to the end MQTT I wonder what this example is It would be another it would be a cool example to have a full interface with an MQTT pulling data or something like that from Adafruit IO or something. I might have another good example if one of these pages had live data from the dashboard Okay, I think we made it through all of those we're looking good Uh, let's get back make sure our Thing here passed and it did So we will also leave a note that says Hi, I never I never spell it right on the first try I think maybe like twice in my life ever I've spelled that word correctly on the first try I don't understand it. I can never I never get it right for some reason even though I know I never get it right and sometimes I swap what I think And I still somehow it's like usb, right? It's like the infamous three Three orientations, you know the three orientations of usb Okay, we made it we've got the review in we've got the merge in we updated the learn guide Glad everybody had a chance to see like the guide updating process. I know that's something that's usually not You know, it's it's generally Adafruit folks, right? And it's not something that gets streamed a lot I know I think scott's done a couple of streams where he's working on learn guide stuff Um, but I don't think very many other folks that do Spend time in the learn guide system stream it. So I think it's nice to see that That part of the system right so folks can see like what the the other side of all these learn guides end up looking like Um So we got that in it has been just a bit over two hours. I think I am gonna wrap it up now I know I put in the title something about the game and watch game And I ended up not quite having a enough time to get too far into that What I will do though right quick here before I wrap it up is I'll just go ahead and introduce that project And then I will very likely be working on that tomorrow morning For my stream So if folks want to watch the game and watch stuff Or if you like me you want to watch the next project I work on You can find me on twitch, uh, or youtube if you uh on twitch, it's filmy guy twitch You can follow that you'll get a notification when I stream in the mornings I do stream generally every saturday morning at 10 a.m. Central time So, you know, I don't know what time zone everybody is in But if you convert 10 a.m. Central time to your time zone on saturday morning Well, it's morning for me 10 a.m. Central time, but whatever time that is for you I'll be on youtube and twitch. You can catch me there. I'll drop links in the discord chat So you can always find it that way as well tomorrow. I'll be working on this game and watch project So for folks that don't know like me. I didn't know this before I got into working on this project There is this old nintendo Nintendo game and watch These were like handheld devices before I think maybe even like before gameboy and possibly even before like nes and stuff came out Oh, it looks like there's modern versions of these. I guess yeah looks In walmart would not be selling the original certainly so I mean these days i'm sure maybe they did in the 90s or something but Yeah, this is a different thing though, right? This is a modern take on it Which actually this might be fun to hack and see if we could run circuit python on i Maybe it's not quite that powerful Uh, but the are so these are like modern remakes of the original thing though. Let's find the actual uh Let's find the older one the older ones were not a color display I mean some of them had colors in it, but they were like this liquid Is it liquid lcd like liquid crystal? It's not like a A display that you can just paint a bitmap on it's more like a watch face or whatever right like it has Built in little segments that it can either draw or not draw To turn on and off those bits of the display So like you know this one it's got this little clown character juggling And it's got a bunch of these little preset balls and it can like hide and show Each ones in order to make you know what looks like to the eye as animation what the human eye will You know perceive as animation Um, there's a couple others of these there was there was a handful of these I don't exactly know how many like about a dozen or something like that maybe a couple more potentially Um, they all have these kinds of like basic screens on them. So it's like even pre game boy It's not just a full screen that it can draw whatever it wants It's very limited to only drawing the preset characters and the preset shapes Uh, you know that are burned into the display it can just turn them on and off So what I'll be working on though is a circuit python port of one of these games called octopus Which is this one So this is kind of the gist of the game here. Uh, you basically you have these uh divers up here So deep dive. I figured this would be a you know a good staying in theme of diving here We've got these divers that dive off the boat. They go down the rope And then they can go over here across the bottom of the uh the bay or whatever we're in here They go across and then there's a treasure chest right here And the goal is for the driver the diver to go down to go over to get the treasure and then go back And go back to the boat to keep the treasure But you have to watch out for the tentacles if the diver gets touched by I believe the way this works is like the last bit of the tentacles So each of the tentacles is broken up into these segments And if the very last segment is visible if it turns on While the diver is next to it Then it will basically catch the diver the octopus will grab ahold of them He goes in here. He swings him back and forth a bit And that counts as like losing a life basically And then I think the deal is you have three lives So, you know, you play until you have gotten caught three times by the octopus You just keep counting your treasure upwards And you you know, you try to get as much treasure as you can without getting Nabbed by the octopus. So that's what the original game was about We'll be making the circuit python port for that And I don't know a hundred percent exactly how I'm going to tackle it But what I'm thinking initially Is that I might be building a more general project that allows this type of Graphical game where you have a bunch of different sprites and you are hiding and showing them At the appropriate time in order to create the You know the whole game basically because basically all of these sprites are kind of like You know preset in there The game just hides and shows them so I think we'll build a couple helper classes or something that kind of behave like this and give us the ability to make these Individual bitmaps and then just be able to hide and show them as needed For the game to to progress. So If that sounds interesting to you, then uh catch up with me tomorrow I'll be streaming working on this. I probably won't finish it all in one sitting. So Possibly next week or some other time. I'll be streaming that as well. So thank you again to everybody who watched Thank you also, especially to the folks who helped out in the chat I think dan that offered up the link to the learn guide a couple other folks who helped with some things like the Terminal commands and a couple of those other things always appreciate folks helping out in the chat Um, thank you again to everybody watching. I'll catch you all tomorrow whoever wants to watch my stream Then hope everybody has a good night. Good Friday a good weekend all that stuff and yeah, I'll catch you next time. Thanks