All right, hello everybody. Looks like I've got some sound going to OBS. We should be good there. Let's just get the chats going here. I see we've got a baby Yoda over there in the chat. How's it going, Sea Grover? Happy Friday to everybody. Janiskew, Janiskew, like the baby Yoda there. All right, so a quick introduction. My name is Tim, and I go by a foamy guy on the GitHub and the Discord. And this is the Adafruit Circuit Python Deep Dive program. So I'm here still filling in for Scott, and we'll be working on Circuit Python related stuff. To take a quick step back, though, if you might be new and you don't know what we're talking about. Circuit Python, this is a version of Python that runs on these tiny computers called microcontrollers. There's lots of different shapes and sizes, circles with alligator clips, the feather form factor, which a lot of them are. There's the Raspberry Pi Pico. There's some with displays built in. There's some with radio antennas built in. All kinds of different shapes and sizes of these things. And we are writing some Python code that we can run on these little computers to interface with other hardware. So buttons, beepers, buzzers, LEDs, radios, E-Ink screens, regular screens, touch sensors, pretty much any kind of little electronical widget that you can imagine. You can hook up to these microcontrollers and then interact with using the Python code. So that's kind of the 50,000 foot view of what we'll be messing around with today. So how's it going over there on YouTube? Beata and Gordy G. Happy Friday. Yes, thank you. Happy Friday to everyone as well. Tammy and Paul over on Discord. Thanks for tuning in, folks. So, yeah, CircuitPython again. You can learn more here at circuitpython.org. It's an open source project. You can get involved with contributing. If you click the contributing link up here, you can also join us on the Discord, which I think I have down on the screen there. Yeah, adafru.it slash Discord. That's the Adafruit Discord channel where there is a CircuitPython dev room inside of there, which is where all of the development occurs. We coordinate through that Discord for the development. Happy Friday, bizarro builds. Thank you, you as well. Thanks for tuning in here. So do join us over on the Discord. If you want to help support the project, but you don't necessarily want to get involved in development, another thing you can do is purchase hardware from Adafruit. This is their website here, adafruit.com. Adafruit is a hardware and software company based out of New York, and they are the ones who are primarily paying the folks who are working on the CircuitPython project. So there's a team of folks who work on the project full-time. There's a couple of folks like me who work on the project part-time, and Adafruit is paying all of us to work on the CircuitPython project. So if you want to purchase hardware from them, then you are helping support all of us working on the CircuitPython project, and we definitely do appreciate that. They sell the microcontrollers themselves. They also sell all kinds of things that you can actually plug in and do with them. They also provide the learn system, learn.adafruit.com, where there are thousands of different guides and projects that go along with all of the hardware they sell. So browse the learn system, find a project that looks interesting to you. This foot pedal looks pretty sweet to me. I think I may make me one of these things. Find a project that you like. You can go into it. You can find what hardware you will need for it, and then you can get that hardware right on Adafruit there. And again, I'll just mention, definitely do appreciate folks who purchase hardware from them. Ooh, what is that? Fancy feather here in the chat. What do we have? This is from the Streamcar M0. Supports custom one-off boards. Yeah, good point as well, Sea Grover. Let me copy the link here. So a lot of these boards are produced by Adafruit, and you can get them at Adafruit.com, but there's also even more boards. There are a majority of boards are actually produced by other folks. So this is a feather form factor device, M0. So SAMD21 probably this is. And this is made by a community member, Sea Grover, who is over there in the chat. So yeah, excellent point that CircuitPython, it's not limited to just the Adafruit hardware. There is lots of other hardware, including custom boards created by members of the community. All kinds of interesting devices that do run CircuitPython. Hello from Arkansas. Shuttle pod, how's it going? Let's see, today's been being patient with FreeCAD. I never did pick up FreeCAD. I tried, I used OpenSCAD. I haven't used it for a minute, but I did learn quite a bit about it and I would consider myself okay at it. FreeCAD looked interesting if that's the one I was thinking of. I don't remember for sure. OpenSCAD fit really nice for me because it's kind of like programming shapes and I am kind of a programmer by trade. So it fit really well with my brain OpenSCAD, but it does have limitations for sure. Ali Noir over on YouTube, how's it going? Thanks for tuning in. Let's catch up the chat here.  Let me check. We are not quite all the way up. I can bump it there. Let me check OBS as well. It's also a little far away, I guess. Is that in frame? Oh, it is. Yeah, let me scoot it out just a bit. See right there. And I'll check. This one looks like it's all the way up here as well in OBS. Thank you though for the heads up. Let me know if it does still sound messed up. Your Python supports went off boards. Yeah, so we made it up to there. Sounds okay to me. It sounds more distant and echo-y than usual. Could be that. Let me just double check. Yeah, we are definitely on the right microphone. Turn this down. I don't think that should affect it at all, but a bit more distant and echo-y. It's a little farther away, I would say, truthfully. I'll try to speak up a bit and see if I can't figure out some settings for it. Looks like I'm peeking around yellows inside OBS. Try CAD query one of these days. It's like OpenSCAD, but Python. Oh, that sounds pretty sweet. Yeah, Python code would be super cool to integrate with. It's interesting the idea to me to integrate 3D shapes with other APIs and things. So the GitHub commits, they release the Skyline model or whatever. You can download your Skyline and then print it if you want. That kind of thing, I think, is pretty cool. Sounds okay on YouTube. Okay, yeah, thanks for the heads up, folks. Multitasking today. Listening to the stream. Reading a book about unit testing with PyTest. I know how to do it, but I have to teach my team at work how to unit test. So solidifying my understanding. Oh, yeah, that's awesome. I will say teaching is a great way, teaching a thing that you have an understanding of, but maybe not a full entire grokking of. Teaching is actually a really good way to understand it more, I find as well. So that's actually, that'll be a fun exercise, I imagine. Level is high enough, just sounds different. Sounds normal now, suddenly switched. Could be like a compression thing or something. I don't necessarily have the bit rate up or whatever. If it slows down, though, I could see that making it sound wonky for a minute. Sounds okay to me watching on the phone today. Oh, nice. Thanks for tuning in from out in the world, wherever you are. So today we are gonna follow up on something I started last week, which is, whoops, we don't wanna go to MicroPython. We are gonna follow up. Oh no, computer died. Oh, that's rough. Sorry to hear that. Teaching is a form of learning, is what I streamed. Yeah, yeah, totally agree. Let's see, we want the PR from TileGridContains. Yes, we want this. And I noticed Scott looked over this a couple of days ago. We got a couple of changes. So we're gonna make these changes. We're gonna build it. We're gonna test it. And then I'm gonna build something that uses this functionality to catch folks up. If you didn't catch last week's streams, this is functionality adding a function called contains to the TileGrid object. TileGrid is like one of the base objects for display IO. So when you wanna put a bitmap on the screen or something like that, you put it inside of a TileGrid or you kind of put it with a TileGrid and use that to show it on the screen. If we have a TileGridContains, it's gonna take a x, y coordinates touch point and it's gonna tell us whether that touch point is inside the TileGrid or not, which is helpful for writing code that says, like when the user touches on this button, we wanna run some code to do something right. So this is the code that's kind of making it easier for us to do that. Of course, we could still figure it out using the x and the y and the width and the height and all that, but having this function makes it much nicer. We don't have to write nearly as much code in the Python layer to do it. So that's what we're trying to do. How's it going, Mark Gambler? Thanks for tuning in. I have a friend who's a surgeon and he said that's why the paradigm in medical school is see one, do one, teach one. I like it, do one, teach one. Okay, so we're gonna, let's see. Couple small things looks like Scott says. Boolean Zen, so I think this is, I took a look over these last night, but I figured I would go ahead and do them on the stream today. Looks like basically this is just don't use the, don't use the if else, but instead just return the value, return the Boolean expression, which we currently have in the if else. Which is backwards a little bit how my brain thinks about it, but is all right. And we'll definitely take, definitely take whatever Scott likes. I do think, I guess it is kind of nice that it compresses it down and then we do have the three, like the way how we do still have basically just, well, we have four conditions essentially. We have greater than the X and then less than the X plus the right edge, which we must have, I guess calculated above somewhere probably. Okay, so we'll collapse that. It is less code, which is nice as well for sure. Doesn't need any, I guess that would be Python probably that has the slashes at the end of the line there. Fix our sentence there. Return with the capital R. We can do that pretty easy. Okay. Actually, those are the only two. So that should be pretty straightforward. We do need to get back to that branch, which is gonna be that branch, which is I don't know why it doesn't load all these the first time I opened this. I feel like it used to do that. Of course, this is also C-Line, which I have used much less. Let's see here. Let me catch up on the chat a bit as well. Similar, if you look at pilots, get their commercial license and while they're still taking more training, they start teaching. Exactly, explaining a concept to someone else forces you to take all the things you take for granted about it, make them explicit. Yeah, that's a really good way to say it. It's a really good way to express that idea. Yeah. Teaching to learn is essential for musicians as well. Nice. Here we go to build mastery in any field. Yeah, totally agreed. So we should have did not in this repo. We could always check it out. That's the thing. It's in a PR. So there is a remote branch for it. I think it probably was in another copy of the project, the circuit Python project on my computer. I have a couple at this point. What is the branch name? We can just check it out. Branch name. It is TileGridContains. That's a pretty good name. Phone Guy TileGridContains. Check it out. We have these things which are unrelated. This is for something else I'm working on. We have not added them. They're kind of like pasted into the repo here, but they're not added into the repo with get add. They're not added. So they shouldn't get pushed when we do this, which is fine. We can just kind of pretend they're not here for now. Clear. This should show us the branch name. TileGridContains. And this stuff is at where? Let's see. TileGrid. Inside shared module. Round 350. Let's do this thing. Tammy taught me this thing. Tammy in the chat. Thank you again for this thing. What do they call these though? I did forget the name of what they actually call them. Doesn't say here either. I was thinking it would say what it is. They're like project views. They're like, I don't know. I forgot the name, but basically you can choose the files that are most important to you in a given context. Maybe they're called Contexts. I don't know. Somebody will put it in the chat maybe. But these things are awesome, and I've made others of these and some other projects for work and stuff. So thanks again for this tip. This was really cool, whatever these are called. This one is for display stuff, which is helpful because TileGrid is inside display stuff, but kind of filters down the files so it's a little more manageable because the project is kind of big, honestly. So this helps it feel a little smaller and gets you down to just the specific stuff you're interested in for a given task or whatever. Sounds good, thank you. Sounds okay, I appreciate it. JetBrains scopes, that's the word. JetBrains calls them scopes, which is I guess a pretty descriptive name, but it is tough because it gets potentially confused with scopes of programming, but they have that kind of, they're just gonna have that problem of like, because their subject matter is programming, parts of their interface might be a little bit confusing because of it, because you have to kind of wonder if it's ambiguous, like, does it refer to your program that you're working on or does it refer to the program that it's in? 350, I think it said somewhere around there, 350. Yeah, so here's our if statement. And so we're basically saying instead of it, we just wanna return, I think it's the exact same expression, right? Git does not show it, Git kind of takes them all as lines. I guess it doesn't have the parentheses either, which makes it a difference. Yeah, that's actually pretty easy. It's the same expression. So we're basically just taking this out of the if and doing return it instead. Let me get rid of this. We'll do the other one while we're here as well and then we'll make a build, we'll test it, we'll do all that kind of stuff. Boolean Zen, apparently they call this, Boolean Zen, returning the expression instead of using the if statement. This one is up in the doc strings, 320-ish, 325, 6, well, that can't be right though. It's in shared bindings, this one, shared bindings. If condition return true, else return true is the same. Yeah, return condition, I tend to prefer that too. Okay, I'm sure I could probably grow to use it by default. I do probably, if I just, well, I did just sit down to write the code and I definitely default to doing it with the if else, but I bet you I could probably learn to learn to love it this way a little better. Let's see, it is more, I guess a synced maybe is the word. Where's returns here? Isn't this, oh, we're not quite down for enough. Returns, is that the only change there? Returns, oh, capital T, true, capital true. Oh, that's interesting. Yeah, I guess we would want it capital because it's kind of referring to Python true even though it's in C and it's actually returning lowercase true as a concept. That's kind of interesting. If first two, if the, should it be the, if first two values, it should be the I think, right? If the first two values in touch tuple represent an x, y coordinate inside the tile grid, rectangle bounds period, also we don't have a period through if the first two values in touch tuple represent an x, y coordinate inside the tile grid. Tile grids? Tile grids? Colorful, colorful rattle. How's it going? Love the factory from Colorado. I think I missed it up there. Yeah, how's it going? Thanks for tuning in. Always appreciate the mountain presence. I expect the compiler to optimize it the same anyway. Note that you could accept the change. Oh, really? Accept the change in the PR? Wow, that's actually pretty cool. I did not know that. Thank you for the, was that an air dock? Thank you for the hip, an air dock. GitHub, that GitHub is awfully helpful. So we can actually, yeah, we can just optional extended. So this is the commit message title. They call it apparently return expression instead of if commit changes. No, yeah, I totally did not know that. That's actually really cool. I'll make this one and push it because I do want to add the N maybe tile grids. Does it feel like this should be tile grids inside the tile grids rectangle bounds? Just tile grid. I guess it's singular. It's like a single instance, right? Maybe, yeah, it probably should be singular, but I guess the S was possessive, not pluralizing. I don't know. I don't know grammar very well, truthfully. Let's see, but it's returning a bool, not the word. So the cap should match the language. Ordinarily, I would say yes. Ordinarily, I would say yes. The thing is that because the language we're writing, well, the language we're writing is C, but the program we are writing is essentially a program that parses and executes Python code. And this documentation here is actually gonna become, or I should say this comment here. While it is a comment currently inside of a C program, it is actually gonna get stripped out and it's gonna become the documentation for the Python code. So folks are going to expect this to be what it's called in Python or what it is in Python. Good question, and yes, ordinarily, I would say the comments within a program, it should keep the same syntax for those cardinal values like true, false, and that stuff. But in this case, there's that extra layer of this program is actually kind of writing Python and the docs get used at that level. Oh, Scur is over in the Colorado as well, nice. I need to get back out there again. It's definitely an amazing place. I do like hanging out on the mountain, in the mountains, I should say, really. Let's see. Compiler optimizing, if that optimize, yeah. Yeah, yeah. I guess we'll just leave that singular. But I do think these should be here, so I will commit it from here and push. True, if the first two values in, there might be, is there a way to do these? Like, I don't know, what is that? Just code highlighting, right? Is there a way to make this come through as a, really, there is probably, right? It's gonna just be Sphinx syntax? Is that, I don't actually know what Sphinx syntax is, though, do any of the rest? I guess maybe some of the others don't. Although these do say true in lowercase on some of them. I don't necessarily wanna change too many things with these commits, but I do actually, for all the reasons we talked about, I think uppercase would make sense, probably. Let's see any that do have the syntax, like code syntax stuff in it. We'll leave them without, let's see. And if it's me rewriting the duck strings in the core, I would make like five mistakes, trying to get the format. Yeah, Sphinx is just generally picky, and then when you add this layer of like, it's not only like just directly into Sphinx, but it's also like in comments and C code, it can get tricky for sure. Sphinx docs has its own thing, I believe. Single backticks are for links to other items, but even though I had to fight with it to get what I wanted in the support matrix, I don't quite understand everything. Yeah, I'll definitely second that. I definitely, there's a lot about Sphinx that I don't quite grok in terms of its syntax. It's kind of like a weird version of markdown. Some things are sort of markdown-like and other things are end up being different. Let's see if we can find real quick Sphinx code highlight. So we don't want the full example though, right? We don't really want to embed, like this is what we want, highlight directive. I don't know, these feel like they're like headers or something. I want like the word highlight on this pages. Doesn't feel like what this page is actually telling me. Fragments late detection? Start after in before. This is like include code blocks like these yellow blocks. Not quite what we want. Yeah, that's at the paragraph level. All right, what I want is like meta. I want, because I'm sure like this page is probably built with Sphinx. Actually, this is just like a, this is maybe just a totally other thing though, right? Chip simplicity, I don't even know. Didn't realize that wasn't just about Sphinx. Inline syntax highlight. Oh no, extension. Maybe it doesn't, but these are like this, right? They must support that. I thought this one has some backticks. Like installing a library though. Let's try backticks and see if we can build it. It's not the end of the world either if we don't quite get it to do that. That's like kind of cherry on the tape. Double backtips, but double back, double backticks. That's a tough one. Let's see here. It's not marked down. It's restructured. Okay, RST, RST, double backticks for simple highlight. That's not a link, sorry. Yeah, I got zoned in there and missed a couple of folks. Thank you, appreciate all of you. Find RST much less obvious than markdown. Yeah, I agree. It's probably because I use markdown more to some extent, but markdown does feel more natural. A lot of the syntax in there feels like this is how I would do it if I was just guessing and not knowing. Okay, nice. Nice, we will build too. I think, is there like a make docs or something? How do the docs get built? Oh no, this is showing redx. Maybe it just has the wrong, oh no, pre-commit failed. Okay, but we'll make sure to run the formatter and stuff, which is helpful, because I'm gonna commit one from mine as well. Just saying here about the docs. No. I think it's the same Sphinx command, but is it, well, no, it can't be, because it's gotta like pull it out of the C code, make HTML, that's right. Is there a like make list all the commands? Is there like a make help or something? I guess make help would probably be it, right? Help, is that list all of them? It does, okay. I don't use, I mean, I use make I guess a lot to build circuit Python and stuff and I've used it in other projects, but I don't know, I never like formally learned to make. I kind of like find a make command that does the thing I'm trying to do and that's the one I use. It's kind of the only level I have. There's actually quite a bit, I wonder. I should go through one of these days and look at what all these things do. EPUB, so it makes like the book of the docs, like a ebook style docs page, crazy. Single large HTML file, oh my goodness. How big would that be? That would be a lot of text, right? That would be crazy. Make HTML. Oh, just make by itself will give you that, even easier. Make tab, oh, tab completion, that's a good idea. Error, mixgo cplib, mixgose, I don't know, found. Mixgo cplib. Maybe I need fetch submodules. Oops, this is a dash. Oh, but tab, oh, tab completion. I don't think I realized that that would tab complete. I mean, I don't know why it wouldn't, but for some reason that never crossed my mind actually. I think I type that out every time and I probably will never do it again. Now that I know that it tab completes, inSphinx make by itself shows you help. Normally it runs the default action. Okay, well that's working. I'm gonna see, is this cable plugged in? All right, now to think the hub off the desk here. Yeah, it sure is, okay. I think I got some code on the PyGamer here that I might pull off. So after we update this PR, the thing I wanna do is work on a little slide puzzle. Anybody ever play with a little slide puzzle? Like this kind of thing, where it's got a picture, or I mean, it looks like there's some with numbers as well. Maybe even the original ones. I think this is based on like an old school toy game thing that might've been this numbered one. But the idea is basically the same with the picture. It's like a, well this one's four by four. For some reason I was thinking three by three, but really it could be any grid size and it has an image or it has the numbers and the colors and stuff like this. And there's one slot open in the grid. There's one open square and you can like, you shift them around. So like, you know, on the smiley face you could shift this one to the left. You know, you could shift this one up and you could shift this one over and they all scoot around. This, I wanna make this kind of thing out of a tile grid. And actually I did already make one. I made it on the Pi Gamer, but I wanna do it on the Pi Portal because I think this touch, this contains function, this is like a, what I think will be a relatively easy example project that will show off like how to use this contains function like one way to use it and one thing to use it for. So I think that'll be a cool thing to make Touch Interactable, one of those. We'll get a nice Blinka picture in there. Those puzzles are uber fun, yeah, I like them. See, note how help doesn't show you submodule sync command. For fetch submodules I think it did on the top there because it was added there but wasn't added to help. Some clever oct code I recycle in my own make files that generates help automatically. Oh, that's cool, I do like that. Generate, tools that generate documentation automatically are really, really good because sometimes people don't dedicate time to documentation and if you can, like automatically generated documentation it's probably not gonna be as good, right? If somebody actually curated the documentation together but like something is better than nothing and if you have an automated tool that can do it like all right, it can give you something that's decent, that's a huge step in the right direction. One to 15, been around since the early 1900s, dang, that's crazy, early 1900s. So the numbers, I think the numbers and the colors was like the first one, right? The white and red, I mean it could be any two colors I suppose, right? This looks like a fancier one even. It'd be interesting to 3D print one of these things too maybe parsing make files with AUK sounds like a challenge. Definitely would be challenging for me for sure. I haven't used AUK very much. Use a special comment on the make target, nice. Did I pip install, maybe not? This failure, I guess this did kind of fail, didn't it? Or yeah, well, build finished but with problems, error one, is that in the root or the requirement stock? I mean, I'm, well, I would assume I probably have somewhere along the way but I have no idea when. Oh, that's wrong, right? Stash R or something, she probably put in there. Yeah, he did, already satisfied. Didn't see the whole list, it might've got something. A math plugin used, yeah, maybe for a micro lab possibly. Actually no, oh, I feel like we got further. Maybe not though, we get all this stuff. There's so many pretty colors on this thing. I like terminal stuff that outputs nice colors. Guess maybe we got this, this part of it does look familiar. I mean, it looks like we're getting pretty far though. We're writing index pages. We've done 90% of them. Let's get to the in there and then fails. Mathjax config, not work for the current Mathjax version, use Mathjax 3 config instead. Is that like a, is that a pip thing? Mathjax or, oh, let's look in that file. We'll go back to here, see everything. Formant stock, math, math, no math. Possibly I need to just update something like, I don't know, NumPy, feels like NumPy might be a thing. It's just a warning. Maybe a thing was updated whose version is not pegged, yeah, that was gonna be my thought, is maybe I have an older version of whatever it is installed. Let's check, where does it actually build though? Cause if it did build the pages, then it's also fine to have a warning, I don't care that much. Is it just index or docks? Index. Oh wow, look at that, choose a browser, Firefox. Well, nice try though, I appreciate the effort. Oh no, we did this before, didn't we? This feels very deja vu. This Firefox, it doesn't let me open local files. Oh, that is so unnecessary. I think I could just do run actually, and this would like, spin up a server. It's really not what I wanna do, but, oh, and we probably just killed the chat there. Let's copy this, that back, hopefully that fixes the chat, are we good now? Yep, looking good, okay. Let's put this one over here, there we go. So, tile grid is gonna be what we want. Tile grid, display, display, oh, tile grid, tile grid, this two matches, tile grid. Hit and wait with transpose bitmap contains, it did, yeah. Double, and I think we were on double ticks, so thank you, I think Shippu, or whoever mentioned that, appreciate it, double ticks on there, looks like it did. Can run Python, that's true, yeah. Python, I actually use that quite a bit. Python, HTTP.server, something, Python3-m, HTTP.server, I use that one quite a bit. I used it back in the Python two days quite a bit as well, I had to learn a new command when three came along. Using a version of this, but with some customized ANSI color codes, auto documented make file. Take a look at that. I've never actually made a make file, a link address. I think it's just a warning, it ends in an error though, yeah, it does look like it ends in a HTTP.server, that one's different than the one I've used, I think. HTTP, or HTTP.server, it's .server. I don't know, now that I'm actively thinking about it, I don't actually know which thing I type. But I do, I use the same one every time, and it comes right to me when I actually need to use it. Interesting, I should look more into make. It looks like it can do lots of interesting stuff as far as like making a CLI to build stuff for you. Yeah, thanks for sharing this. Yeah, I do like that. That's definitely a really nice auto generated thing there. Like if it's that or nothing, this is like super nice, self documented make file. Oh, there was one in the next thing down, dang it. I scrolled up and up and up looking for an example of one and there was actually an example in the next one down. Seriously, the next one. Oh, okay, no, actually they're out of order. Okay, it wasn't actually in the finished page, it's the next one. I feel better about that than actually slice. It must be down here, yeah. Yeah, there it is, same thing, okay. Anything else, oh, we do wanna run pre-commit. Oh, pre-commit though, I don't run it anymore, right? We use pre-commit install, which it should be installed. Is there a way to check if you have ran pre-commit install? Could just run it every time. I guess there's probably not a downside of running it again, is there? Check if pre-commit is installed. See, I find this hard too, because this is gonna be like if I have installed it like with pip probably install is just a verb that's already used. Pip install, I think we just run it again, right? There's no harm in running it again. Pre-commit install, install that. And so then if I go to make a commit, it will run it for me. We'll check my changes here. Returns true if the and period at the end, and then also some formatting on that return I think. Yeah, it looks like pre-commit, clang or whatever the C4 matter. Oh no, I didn't forget that. That's part of the change, right? Because it was the parentheses.  We should make sure it actually works. Make, forward, pipe portal, titano, clean, J4. All right, we'll make sure this works. Let's plug this in. Oh, I gotta get this plugged in too as well. Let's see, let me catch up on the chat here as well. Instant PWD HTML server, changed in Python 3. Yeah, that's what I remember. That took me a while to learn the new command. I had it memorized for years and years with Python 2. That plugged in. Oh wow, look at that. That was actually kind of fast. 33 seconds it took to build that, dang. And I did a clean before that? Did it actually clean? That's pretty crazy actually. Okay, so then let's get to boot pie. For boot, portal boot, I guess this one is. Cp build, firmware. I use make files for fiction writing, interesting. Write in markdown and or latex and have make files to build the PDF and ebooks. That's a really smart idea. I like that. I use, I don't have a make file for it, but for a work project, we do all of our documentation in markdown and then we use a Python tool called mkdocs. I think it's Python. I run it with Python at least. We use a tool called mkdocs. I know that's the name of it. And it builds the markdown file. It's kind of like Sphinx in a way. It builds the markdown files into HTML pages. And then those get served alongside of our system. And I have a Python script that I run that builds it, but nothing as fancy as make. That would be a good spot for it though. That might be a good place for me to learn about it is re-implement that part of it. Used to use make files in place of source management program. I had a command that would target GZIP the current source with a date and a name before there was GitHub. I'm guilty of like Dropbox was my first like source management version control thing because they had it would keep a history for you. And it was all just automatic and I used it on multiple computers and I just did put my projects in there and it synced it across for me. It's definitely not anywhere near as nice as actual version control, but it got me by for quite a while. The other make files in CircuitPython run all by default and you can run more than one actions at a time. So you can do, oh, interesting. Okay, so you can just always get clean builds by adding clean all at the end. Interesting. You can do all by default. Does it have to go in that order? It feels like the clean should come before the make, but does it go in reverse order or something? Let's see, we got this installed. Let's go to our device thing here. I caught up too, yeah, we're caught up there. Okay, let's get this and see, no idea what would be in CodePy right now. Take nothing on the screen. Oh, is the camera working too? Kind of doubt it, right? We're having trouble with the camera. Some times these days, age is working. Browser, gonna crash on me. Yep, let's see if we're gonna get it. Hopefully we'll, hopefully it'll, it's been coming back to me after I kind of just relaunch it a couple of times. It's not a good place to be, but could be worse, I guess, if it didn't work at all. Okay, turn the light on or whatever if we need to later, if it's like too washed out for us, but this is good for now. I've been, last couple of streams, I've been trying to keep the camera in its own window over here, so I'm getting a little bit better at juggling with it. I'd actually go back to it correctly when that's what I'm trying to do, but not quite all the way there, so I'll try it, I'll keep up with that today. Let's see, make board clean all is equivalent to make board clean, make board all. Oh, I see, okay. Board clean, semi-cool, and make board all. It's not clean all, it's clean, and then all I see. Cleaning after all makes no sense, I see. Cleaning after, oh, let me check what this says. One second here, let's see, this is gonna be over here. Nice, okay. Sorry, slight delay. This has been the first week of a new developer at work, so I'm the lead and was for just a little while there, the only developer. So we got another developer back. I had a partner for a little while, but she left us, and then this was the first week of the new developer, so I've been working very, very closely with them to get them up to speed. He's checking in with me there. Got to publish HTML docs on the internet, assume SharePoint or Microsoft Shop. So I don't know, I can't really tell you too much about SharePoint or Microsoft Shop, I don't know really anything about either of those two things. Publishing HTML docs on the internet though is actually, it's relatively straightforward. I will say what you need is a computer with a, you need a computer with a public IP, right? So you can, usually people will pay for either hosting or server or something like that, and it will come with a public IP. And then you can put your HTML on there, and then there's actually lots of different programs that will serve it for you. There's also services that will let you host it without you needing to care about what program it uses, right? They'll just have like an upload thing for you to put it. Actually speaking of, you can actually use, if your HTML, if it doesn't have, I mean it depends what it does, there are pages that won't work like this, but static HTML pages, you can host them in GitHub. Like for instance, well I mean circuitpython.org, right? I think, if not circuitpython.org, definitely awesome circuitpython, circuitpython.org. I'm pretty sure this gets hosted inside of GitHub. Like it just, the HTML is in a repo somewhere on a branch and it loads this page for us. It's got a URL that redirects it there, but I think that that's GitHub. If not this one, definitely awesome circuitpython, which I don't know. Is that the right address for it, Python? Or that one may even be a GitHub address. Well this is the repo, there's a page too though, isn't there, I think there's a page. Am I misremembering that? I feel like there's a page, is it linked from here? Awesome, here we go. Oh okay, it's part of circuitpython.org. Okay, but it is a static HTML page and I am pretty sure it's served on GitHub. I don't know the exact place or branch where it comes from, but I believe that this type of static page is all served on GitHub. So that's one way you can do it as well, which is nice because GitHub is free for public projects up to some point, which a point I haven't hit, so definitely free for a lot. I have a lot of repos on GitHub. I think the way I found unfortunately is do PDFs, yeah. There's lots of devices that have PDF support, even though it's kind of a weird closed thing sort of. Microsoft sells SharePoint like it's an application. Yeah, use my repo. Yeah, that's what I've done for basic stuff is just hosted on GitHub. Like, wanna share that? Yeah, I can share that. Teachlinks.xyz, this is like ugly basic page, but this is a static HTML page and it's hosted in GitHub. I use this page of links for some classes that I teach sometimes. Yeah, that's what it is, pages.github. That's the exact service that that uses, yeah. Thanks for the link there. You know, it's, I mean, Microsoft server infrastructure is just generally hostile. Well, I mean, that's true. I will say though, I mean, like there are so many faces to Microsoft, right? Like GitHub is also Microsoft at this point and GitHub pages works pretty good for hosting that kind of stuff. So it's not like maybe Microsoft proper I would grant, but there are different facets of it and I think just different tools are gonna be better or worse for different things than amongst their vast profile of stuff. There are some that are gonna be pretty good for that and there are some that are gonna be pretty annoying for that probably. Let's see here. So we need to test that with, we should have, I think there's like just how grid touch test or something, right? Probably. Well, it's gonna be not in here though. It's gonna be device workspace. How grid contains tests, that sounds promising. Yeah, purple bitmap, put it on screen, put it somewhere, tell us if we're touching it or not. That sounds like what we want. Let's copy that, put that in code pie. What is in code pie? We have raw sample stuff. This was testing for brightness PWM thing. It's not quite the exact, is it? I don't know, I guess there's a compare in here. See how close it is to this. Okay, it's pretty close. Just the comments are the only difference, pretty much. Okay, but we'll just keep the other one. We can just erase this, we don't need this. Instead, let's get this one, tile grid contains, put it in there, save it. Back to our camera. There's our flowers which are purple in real life but looking a little washed out there. Not too bad though. Where is the idolist today? Oh, right over there. So we'll need the printouts as well. Repel like right here, maybe. Can touch on that, let's see what we get. Touching flowers, nice, doing good. Now there we get outside, outside, outside, outside. Eventually touching flowers. Looking pretty good to me. I think another good basic example of this might be like drag and drop. Like have a tile grid that you touch and move it around, just stays on the screen but beyond the bounds of the screen or I should say within the bounds of the screen it can just move around anywhere. See here, github pages is available for private repos with paid github pro enterprise subscriptions. Yeah, I can't tell you too much on the private repos. That part of it I don't have any experience with. All minor public repos. But like in general and there's exceptions, Microsoft products which they acquire tend to be more user friendly than those that develop themselves. Yeah, I'd probably agree with that for the ones that I use as well. Yeah, I don't find, I mean at this point I guess the only one of theirs I use directly is Teams with any regularity. And it's definitely not my favorite, not my favorite program to interact with by a long shot. So it looks like everything is fine here. We will do the pre-commit but that should happen automatically when we do actually make the commit. So we tested this out and it does still work. We're gonna go to make our commit. It put in an extra line or something here. Oh, actually I never pulled. Let me pull that change that we did on the page. Yeah, that's what we want actually because we want to take the change from GitHub for that part of it. I'll just do take remote if it has a conflict. That's right, what are we doing here? This, it does like push to that branch, right? I'm misunderstanding how that works. Yeah, it looks like it did. Okay, oh, it's gone. Branch protection rules. No protection, just pull. Update project. This bar is like one of the most useless things in JetBrains IDEs. I love the IDEs. I do, there's lots of parts of them that I love but this bar, it just says updating. It doesn't tell you anything else and then it's like you click on it, you expect more stuff and you get like one extra word update project instead of just update. Nothing extra. And this bar, it's like it never really fills in. It always just does this kind of plasma thing. I don't even, that may not come through the stream, truthfully. I don't know, are we like stuck or something? We're having so much trouble. You know, I guess I never pulled main either. It's not, it's not updating main and doing a bunch of stuff, is it? Okay, finally, here we go. Oh, I can't close this now. Interesting. Is this is in front of it technically, but not actually? That's funny. Do it over here. No. Okay, well, you can hang out there for a minute. We want remote. We just want to take remote all the way. Remote, none of that. Why? Now we can finally try to commit and then it will run pre-commit before it does actually do the commit. Fix, Tains, Dockstream. Robert disguised as a progress bar, yeah. Yeah, totally is. Fix contains Dockstream. We will say tile grid. Okay, and then I believe this will fail the first time it tries, or not. So why did it fail pre-commit up here, though? See, thank you, Scott. I don't know if Scott's watching, but thank you, Scott. What, why does it not catch that, though? Cause I did a pre-commit install just a minute ago and then I did make a commit and it didn't fail. I don't look like it ran, truthfully. I feel like in the wrong directory? Does it do, does it not work if you're in the wrong directory? I was in the root, though, I think. Commit install. Okay, well that changes how I thought I knew about how that worked. Changes what I thought I knew about how that worked, I should say. Where was that actually at? That was in module 350-ish. You know what? It doesn't, okay, okay, okay. It doesn't think that it's one of my changes because I pulled it from GitHub. So my local pre-commit doesn't know that I made that change and so it's not running the formatting against that file, basically, or against that part of that file, at the very least. So if I ran pre-commit run all, it would run. Which, actually, I can do that because it will, for a while, I was not using pre-commit run all because I thought it, well, not I thought it was.  I figured out though I had the wrong version of something black or it goes black because it was Python code but I don't actually know for sure what it was. I had the wrong version of something, I updated it and then it was back to being the same as main. So actually, if we do run pre-commit run all, dash dash all, dash dash all, should not, it should fix the thing that was wrong and it should not have a ton of extra changes. Yeah, pretty successful. There we go. Did I actually ever put my test code in here? I would actually have my test code in here. Probably should, so there's at least somewhere with a kind of a weird, weird thing because it's not a library specific so there's not like a great repo place for it. I guess Learn Guide Repos or something somewhere but I don't know, it looks like I, I think I stole it actually from the Display IO Learn Guide and just added the one extra part to it with the touch call there. Here we go. Scott's making a guest appearance reviewing today on the deep dive.  Zorb into something else, yeah. Okay, we'll let this one go. It'll take a while, I'm sure, to do the checks on it, run the actions, but looks like we're pretty good there. I think, did Scott mention also groups maybe? Yeah, groups would be cool. You agree with that as well. Yeah, I think it would be nice to have this on group too. Group is a slightly trickier one because it has scale and it's actually group is a lot trickier because it doesn't have width. I think that's right, let's look though. If I pass it, I must have passed it, right? Because these are before G in the alphabet, E F G. Yeah, there it is. So it does have a scale which makes it a little trickier. It does have an X, Y, but it does not have a width property. I mean, it doesn't have a width property that you can access. Like intrinsically, it does have a width. It does still represent a rectangle on the display, but in order to find the width of it, you would need to loop over all the child elements inside of it, all the things in the group and you would need to find their X, Y and their width as well. How's it going, Scott? Thank you for the review. I appreciate you. Yeah, group would be trickier. Group would be really cool though. We, I think that probably starts with adding a width property. Otherwise the code inside contains is gonna get pretty gnarly, but actually having a width on group would be really helpful as well, even aside from contains, because you could also do stuff like easier. It would make it easier to put it into the middle, like center it in the display if it had a width and height that you could look up. And I think the way is you would just, you would loop over all those elements and then find the one that has the maximum X plus width and then also the one that has the maximum Y plus height. The X and Y are the top left, the top left corner. I think there's a diagram type thing in this. I wanna say, if not this one, well there's one in label, but label is actually a little bit different. Maybe bitmap. X, Y, the XY point is basically the top left corner of the tile grid is what we were talking about a moment ago, but this is bitmap, but it works the same essentially. Top left corner of the rectangle is where the XY is at. I figured from ago it was streaming after reply so fast. Yeah, groups should just call contains of its children. Oh, interesting. Then there will be a region that is inside the group but outside the children, I think, right? Cause you have a group with a big thing, a big rectangle representing the group, but then a small part of it, like in the bottom call contains on its children. That is a good way to do it though. It would be nice to be able to loop through all of them and do that as well. Actually, that's not a rectangle. Where's a rectangle? Well, we have a rounded group, but if you have a group and then if you had like one thing inside the group that was down here, cause then the full group has to be the whole thing but only this would be contains true if it looped over its children. And so then if you touch here, it would not register. Group is more of a coordinate space. Yeah, I remember I've seen your description of it somewhere. I don't know if it's an old PR or somewhere. I have read an old description of yours of it though, the coordinate space. Yeah, it's kind of like a coincidence that it happens to also represent a rectangle on the display. It does just because the nature of pixels but it's kind of like secondary to its functionality. Okay, so let's try to make, well, let's look on the Pi Gamer cause I think I have code that does roughly what we want and we can translate it to make it work on the Pi Portal using our new contains method. We could actually also, you'd probably modify the Pi Gamer one if we wanted. It uses cursor control which probably also could call contains, I think. Let's see what's on here. What do I have called that? Probably slider puzzle, hopefully. This is the wrong device, I don't trust this, refresh. Okay, not the wrong, well it is the wrong device but it's because there's two, which makes sense. Don't think of group as having bounds, it just contains children. Yeah, I see it the same way but it does because its children have definite bounds themselves, it ends up kind of like, it does have bounds, it just doesn't know about its own bounds but it could like, it could always loop over all its children and then find out what its real bounds are or what its functional bounds are, not even real cause they're aside from being real truthfully, they're not part of its real existence but they just kind of intrinsically exist. I think slider, slider game, there we go, slider puzzle and then we still have this entire grid test so we can just leave that contains test rather so we don't need to keep it, put this over. This will probably, it should fail the first time cause I don't have the right picture file. Oh and it's also still set up for cursor control. So let's start, let's hack it up a bit to not use cursor control. Well, let's run it once on the Pi Gamer and you can see what it does. I talked about it earlier and it's pretty straightforward if you've ever played those slider games but we might as well show it as well, right? Let's do that. I put this over here. We'll go to the Pi Gamer. Gamers here, we'll take whatever, this is some kind of radio stuff. This is, yeah, this is my radio message program thing. I think RFM, random message pack. I called, what did I call this? It was like a mail, something mail. Serial mail CLI, something. I don't have a copy of it anymore actually. It'd be in the repo somewhere but, Radio R, is there R's for radio mail? Nope, okay. So we'll make a copy, code, radio mail, CLI. This is like Lora Radio's very, very, very, very primitive email program type thing with an inbox and send to addresses and that sort of thing. Very rudimentary though. Okay, so we have this Blinka photo but the Blinka is all split up and the right parts are not next to each other and you kind of cursor around and you can click each one and it will scoot it to the available space. Some of the tiles are tough to see, like this one doesn't have much on it, right? Only the right side of the cupcake there is a little sliver. And I think this program doesn't, oh, looking the wrong button, that's why. I think this program does not, it doesn't play fair. I think it will give you a jumble that's not actually solvable. So this is probably not actually solvable, truthfully. Eventually what I did is I implemented the B button, the other button, to be a cheater thing. So you can go B button, click on a tile, go to the empty space, B button, click on that and it jumps the tile there for you. So I gave a little cheater way to finish it. What we really need to do is change the logic though. So when it jumbles it, it jumbles it into an order that's guaranteed to have a solution.  Tracking bounds could be a good optimization. I'd be done for that. I'll probably, I probably will tackle it one of these days because I would really like for a group to be easier to center. Like if you have a group that is smaller than the display, be nice to be able to center it in the middle or vertically either way. I like calling contain on the children that way a group can be a sprite with a complex shape. Yeah, complex shape. I know, let's see, a sprite with a complex shape. Well, I think, I mean, I think it will always be a rectangle. Well, I guess, I mean, it's not necessarily supposed to be one way or the other. I guess in my mind, I suppose I think of it as a rectangle. I think of it like, oh, I erased it. I think of it like this. Well, we could make this one square. Send this one to the back. So in my mind, I think of a group like this, like the blue one would be a group and then the red one would be like a tile grid inside the group. And you know, you could have multiple ones and they're placed wherever they're at. Maybe one is up here and maybe one is over here or wherever they're at. And these can be different shapes and sizes, of course. And they could be tile grids or they could be labels or they could be on-dispit maps. Well, actually on-dispit maps just use tile grids, but shapes, vector IO things, they can be all of those things. Group isn't meant to have a shape. It's more to move things together. Yeah, let's see. So this code works fine on the gamer, of course. So we'll switch it over. Can I unplug this? Because I saved, did I save one? I saved one onto the Pi portal? Yeah, I think I did, right? Because we ran it and it failed because it didn't have cursor control. Yeah, okay. Let's unplug the gamer. Yeah, there it is. We will turn off the gamer, which I almost always forget to do when I use it because I forget it has a battery in there. Well, not by default, but mine does. I feed this cord through without wrecking anything here. Oh no, camera died. Oh, let's see. Very blurry. Do I still have this one? It actually still hooked up, focus? Yeah, sure is. I'm surprised that still works because this is just like on a page and the browser is just hanging out over there and the whole server went away, but the page still sends post back when it's down. Odd parity. Each tile is a child. And if you were talking about in this example, like all these red ones would be, yeah, they would be children of the group. So the blue one represents the group and then the red ones represent the children. And then really the outer bounds, like in my mind, the way it works is the outer bounds actually line up perfectly. So like in this case, it would actually be more like this. The bottom line is at the bottom of the lowest child and the right edge is at the right most edge of the furthest to the right child. And the shadow is obviously not part of this. That's just kind of default way this drew, but this is kind of how my brain thinks about group. In the actual API though, it doesn't know its own width or its own height like that. It's not meant to have the shape. It's really just meant to tie all of these children together to give them that common, well, two things, scale and coordinate space. That way you can move them all together and then scale them also if you wanted to go bigger on the scale of them. Contain in the computer programming sense, not visual in my mind, literally grouping things. What does it mean practically? What's the use case of contain X, Y on the group? My use case would be making a super fancy button. You had a button that was a group containing like a background thing, a middle ground thing and a foreground thing or something. You wanted all of those layered together. Theoretically though, I guess at least one of those is a tile grid probably. So maybe that's not as good of a use case as I thought it was, truthfully, cursor control. So let's cut that out. We're on the, yeah, we're on the pie portal one. I unplugged the pie gamer. That's gonna cause red wherever we use cursor. Get rid of that and get rid of that. That's gonna make more red down here where we try to use it. So here is where we'll have a touch screen stuff instead. TS, we need to initialize, there we go. Display, do we have display? Yes, touch screen, import. Could return a child instead of true false. Ooh, that would actually be really nice. Then you could have multiple buttons inside of it. Just call one function and get back the one that was touched. That I would like actually, that would be really nice. Because right now the logic, yeah, the logic right now gets kind of hairy.  Does that thing contain the touch point? Does the other thing? It gets even weirder too with the tab layout or the page layout that I had been working on a couple weeks back because then it's like, not only does this thing contain the touch point, but is it also relevant right now? Is it on the display right now versus not? If we have logic like that, where it could tell you the parent thing could tell you which child thing is being touched, there's only one group visible at a time with those layouts. And so you could just get the currently visible group, ask it which thing is being touched and then handle that touch. That would actually be super nice for the, as a way for the logic to work is for like API touches. The API for touches rather for reacting to touches. I do like that. We don't really need this anymore. Cursor is clicked. I think I don't really need that. We can have ifp and then I think what we can have is like ifp and then we should have tile grid. So we can say if tile grid.contains new function and then we're going to go inside there and do this. And alt click we'll worry about later. Alt click was my cheater button. Really though you wouldn't need a cheater button if I fixed the logic to make it give you a fair playing board anyway. And then the only other thing we have here was this was getting the mouse cursor X and Y in order to basically tell you within the tile grid which actual individual tile within the grid got touched. And so this basically it's gonna be p but of course it doesn't have X, Y it's just zero. I need to update my stubs. That may be all we need to make this functional. It's still gonna be cheater. It's still not gonna it's gonna give you boards that are not solvable but I think it will function. Oh well we don't have the image still though actually so it'll crash because it doesn't have the image. Yeah I should have left the pi gamer in back on there we go. Here refresh there we go. We could use a bigger one of these on the pi portal as well. This one is whatever size the display on the pi gamer is I think actually it's a little smaller. Yeah there's a little bit of bar that's not used actually. What size is this actually? Blink a slider 160 by 120. I think 160 by 128 is the pi gamer display if I recall correctly I'll plug that. I do yeah I do like when I think about that I do like the idea of looping the children so we would basically need what other are there other there are few other children that would need contains because I think there's a few other things that can go in a group shape. Does shape use a tile grid or does shape go instead of a tile grid? I always forget about shape. I still have the display Iodox. Shape is a lesser used one anyway truthfully. So shape. All right so it doesn't have an example here. There is an example of this somewhere. Actually I started a repo of examples that I ever put shape ones in there. There is a repo in circuit python org of core examples. Module examples. I don't know that I if I put shape display Iodox does have shape in here simple test. Ah you use a tile grid still. So that would actually work. It would work fine. I assume as long as this tile grid knows it must know the shape size I guess. Vector IO maybe vector IO objects those can get added directly to groups I think right. Planted the seed of an idea. Yeah for sure. Well I mean a lot I mean in this case a lot more of the seed right cause it's all built on display O which is also all part of circuit python. So definitely planted a lot in this forest for sure. See it looked like I yeah this looks like it's working here so it's kind of small and the white washes out the screen quite a bit and it's all tucked up into the corner. We don't consider all of those things though and we try it. Worked once. Tile index out of bounds. Oh okay I think tile index out of bounds. Interesting. 94. When we print. Interesting. Quick to tile. Has been a while since I wrote this code. Divide I wonder if we're like off by one error. Let's rerun it and just see if I touch outside of it cause this should also be limiting it to only when I touch the full thing. If any objects in a list. Short circuits too. Oh it was a comment back to here. I don't think I saw this actually. In short circuit the O stop iterating as soon as any child returns true. Oh inside of contains yeah stop yeah stop running after it. Yeah that's good point. So the for loop you can have a way to bail. Yeah I did miss that one. It's definitely true though. Okay so if we click outside does this crash or only if we click inside on something that it's not liking for some reason. No it's fine out here okay. We clicked once and that worked. Hasn't crashed. Click again and that worked. Left edge. Tile index is out of bounds. Feel like we should print clicked tile also. We're getting a negative one maybe. Have something that was one based before and it's zero based now or something that's kind of what this is feeling like. CPython at least I think any takes an iterator. I don't know if you use the list you need an iterator or generator. Oh we got it out of the gate that time. Was out of index. Two three. Is that our print? Okay I'm trying to use f strings. Trying to remember to use f strings. I have to like consciously think about it but I don't know if I showed this last time. Three three that time. So it's not the left edge that's my problem it's the bottom edge. Wait what oh okay this camera if you died again. I was like that's not that's different okay. I have got to get I've got to get my down shooter sorted out this phone I don't know what's going on. Last couple of weeks though this phone just cannot keep running this camera thing like it has been the whole time. I'd like rebooting it and a couple of different things. Had no luck. Interators are still hard. Let me check on this real fast as well actually. Linux yeah I can do that. Interators are hard for me to reason about in my head I need to build a few to solidify. Just a for loop rotated by high over two into the imaginary domain. Okay. So I'm going to try the top one here. Actually I get it right away with that one. And we said four two harder for me to aim this way. It's kind of reflecting it back on me. Oh we are getting some weird stuff for sure. We may need to oh you know what we need to do actually is we need to use the calibrated. We need to use the calibrated touch values. Yeah yeah these are the defaults. We need to use the calibrated ones and we'll get this much much better behaving I bet. I don't still don't quite know why it's crashing. I suspect it's kind of picking up the touch further out than it really is and that's causing it to crash although I don't quite get exactly why that does cause it to crash. I would think it would be bound still and not have an index out of bounds but it seems that I am wrong. Where I swear I have touch screen calibrate or code touch calibrate. So this I also dealt with on the stream recently as well. Folks are interested in this project. This is a thing that Seagrover made, member of the community that will help you calibrate your touch screen for you. We did some testing and some reviews on this I think on a couple of streams last week. Folks are interested in this tool and kind of the history on how it works and what it's used for and stuff. Okay that's looking much better. I got the thing paused here let's see. Okay not for too long luckily. Contains XY group for child and group children yield. Child contains XY. Oh yeah so write it as an iterator there. Can we do like yield stuff from the C level? Can we have like the Python concept of yield but it's coming from the C code? Should look into it like a Sinkai or something I guess I haven't really looked at any of that part of the core if it is. There's anything like that in the core. Okay so let's see if we're still getting some lander stuff here. The other thing is we could make this bigger. I do think if I mean the easiest way to make it bigger would be to scale the group that it's inside of but that would throw off some of the math for the clicked tile. This would need to multiply by the scale somewhere. Would fit the screen nicer though. We could also find a bigger bitmap too. The cool thing about this is you can actually just put any bitmap you want right. So my bitmap is Blinka with this little clue thing on it right. Magnifying glass and then I also put the cupcake one in there as well. But you can do any bitmap. You might, there might be code referencing the size I guess I'll have to do that maybe. There could be code that's like based on the size we can make that dynamic but essentially it's very easy to swap in your own. So the idea is like hopefully people could take this project and make their own slider puzzle out of it. Not necessarily just always use Blinka. I gotta tilt this cause I cannot see with the glare. Works way better now. Way better. I haven't crashed at all either. But that's so weird. Where, I mean there must be a place. The edge, okay on the very edge does crash. Very edge. This feels off by one. Probably the very bottom edge crashes too right? Surely. Let me catch up on the chat here. Oh also Gordy G over in YouTube. If it doesn't have a size you shouldn't be able to see it. I'm not sure where we were at when you said that sorry. I just noticed it. Over level contain itter init itter next. Any contain itter. Nice. Yeah I'll second what Tami I think it was said up here. Yeah generators, I don't have a lot of experience writing any. I think I probably would if I did sit down and solve a few problems using generators probably would have a much better mental picture of how they work. I used them a few times but it's only been a very few times. Okay let's try, oh bottom edge. That's what I was gonna do. Bottom edge. No I don't actually crash on the bottom edge. Out left edge? Now left edge works fine. Only right edge. We must be off by one right? We must be going further. So it says click tile four one. Yeah we don't have a, we shouldn't have an index four right? Because it's, oh we got the whole star together there. Zero, index one, index two, index three index. So we should yeah we should only have three. Generators only generate the next thing as you need it. So when we crash it, it's because it gets to four. Which means that the touch x divided by the tile width which is, well we know our width of our image is 160 and we know we have four, we have four tiles so each tile is 40 pixels. So our touch x divided by 40. What is the actual E also, let's do that. Feels like we're just touching like the very last pixel and that is making us divide and be one index too high. Which now it's not gonna do it, there we go okay. Yeah we touched exactly on 160. Exactly on 160. And then because we also didn't have the touch screen calibrated before some of our other touches weren't lined up exactly with where the stylus was at which means we probably registered at 160. So the real question is though, does that mean there's a bug in contains? Cause that does feel like a bug in contains right? 159 should be the last pixel that returns true shouldn't it? I think so shouldn't it? Oh it wants a third thing here. It's gonna ignore it though. Yeah, true, false, about zero, zero, zero. 160, what was the height, 120? True, yeah I think that's a bug right? How grid that is 120, excuse me 160 by 120. It's at zero, zero so its top left corner is zero, zero on the display. Which means it's far right edge is pixel x index 159 which means 160 is outside it should not, it does not contain 160 equal. We didn't account for the zero based x but the sort of one based tile width if you think about it that way cause you can't really have a zero tile. So these ones should be less than but these ones should still be equal because zero, zero is that should be true, that does contains. If it's in top left corner, if we moved it further away of course it wouldn't but yeah this is the wrong one with the build thing. Nice, I'm glad this project uncovered a bug. Hopefully that wouldn't have finished running actions or anything right? This is still here as a PR isn't it? One more change coming. I believe I hit the exact edge of that too. I did do all of my testing on this I did do with the touchscreen. So I did not, I probably should have test the edge cases better. I should have specifically tested zero and the exact width probably negatives and stuff as well honestly. What does it do if we give it negatives? That doesn't cause like, I mean it should be false but it, I put it to boot loader mode. Yeah we can't check it right now cause it's in boot loader mode. Luckily we are finished here. Copy, yep, do that. This is the wrong file. Okay so this should be false now. Yay, false now. And like that should still be false like this. Indeed, yep. Negatives, negative one. Yeah, false, no problem. One thing I don't know like, done? Not a number? I don't know what that's gonna do. Okay. Be a lot worse. This is the other like this kind of stuff I probably should have been in the habit of testing but oh wait, what's the problem? Oh we're already, we're inside a string. Can convert string to int. I already saw that though, yeah. Okay that's fine too. Okay those are all fine. And now zero zero is true but 160, 120 is false which is what we want. True, yep. False, 159 is still true. Whoa, 159 is still true. Yes, okay. Whoop, too many. Right and bottom edges of target contains. So this should run pre-commit automatically. But it should have passed, right? If we run it manually we should have no changes. Be sure that's supposed to be running automatically. And if it fails then it won't, this will not succeed. It will, I don't know, pops up a thing down here somewhere I think is where the error comes. So yeah, we did pass so we should be good. So I'm gonna push that. It's got the one change, no more equals. Yep, looks good. Push. Okay. So unfortunately that doesn't mean the actions are all gonna run again. But luckily we actually have the right logic now which is good. Okay, 553, that's probably about it. We're probably gonna wrap it up here. I do still have a few minutes so if there's like any questions or comments or anything in particular somebody wants to talk about or ask about or anything like that, I'm happy to do that. I'll play around with this for another minute or two here. But I think that's pretty much where we're gonna wrap it up for today. Got the whole cupcake together there. That's pretty nice. Well, not the, we're missing the very top of it but we've got a lot of the cupcake together. I think maybe this little, see where is the last part of the cupcake actually? I guess the two I think. I have an easy way to get it over there though. We'll say it does. I think I'm touching it with my other finger too though. I'm having trouble aiming quite right. Yeah, there we go. As soon as I, if I look at it instead of trying to look at the screen and like count for the angle and everything I hit it and it does work pretty good actually. No, yeah, the cupcake doesn't fit with that. I don't know where. Oh, I guess, well, the two. I suppose the two is the top but I don't think we can get it up there because of the way that it's generating a bogus thing, basically generating a version of the puzzle. Basically, it would be like if you actually had one of these puzzles, if you broke all the pieces out and then put them back in in the wrong order put them back in an order that isn't valid basically that doesn't have an actual solution. The way it's doing it, I didn't really look over the code. I'll run through the code real quick because we do have a few minutes here and it's pretty basic code as I recall correctly. So we initialize our touchscreen. This is all new stuff we added today. We load up the image, which is our BMP file. In our case, it's that Blinka with the cupcake and the star and the magnifying glass. We create a tile grid to hold our bitmap. Let's see here for, so we're getting a group and then looping over basically all the indexes that are in our tile grid. Our tile grid is four by three. Therefore it has 12 indexes. We're looping over zero through 11, essentially. Just adding them to the list, that seems, gotta be honest, that seems a little wonky, right? I wrote this code a while ago because we could always just use range, right? Why would we need these in a list? In fact, we just loop again right here. Suspicious, we'll see. Put them all in a list. Oh, okay, so I see, I see. It's putting them in the list that way it can like, it's like it's taking them out of the hat. It's like it put them all in the list and then it's gonna choose one at a time and by taking it back out of the list, it's making sure that it doesn't get chosen again next time. That's what's happening. Okay, yeah, it's kind of weird. There's probably a better way to do this. That's how it works, though. We're putting those indexes in this list, then we're looping over the same range here, the zero through 11. We're looping it again. We're choosing a random choice from our tiles list, our numbers, zero through 11. So we're choosing a random one of those indexes. We are setting the tile inside the tile grid at I, so the first one will be the top left one. We're setting it to our choice. Whatever our random index was, we put it there. We remove the choice from the list that way we can't choose it again next time. We print for some debugging there and then it's just gonna iterate over and over and do the rest of them. So it'll put the first tile first, choose a random one, fill it in, choose a random one for the next one, fill it in, choose a random one for the next one, fill it in. Eventually it will go down to the next row. Do the same thing, right, like that. On the 11th tile, the very last one, it will set it to the blank tile index, which in this case happens to be 11. This is making a rectangle for the background. So the reason why the background is white is because we have created a palette for our rectangle. We put the white color on our palette, created a rectangle, put our white palette in it, we set it to the display width and display height, so it's the exact size of the display. Put it inside of our group and then we put our tile grid inside of our group on top of that. So we have our white background behind. We have our puzzle tile grid in the foreground. We show that group on the display. We don't actually have alt click anymore, but the PyGamer version did. Find blank neighbor, this function will look at the four neighbors of a given location in the grid and it will return the location of the one that is the empty tile. And if it does not find one that is the empty tile, i.e. if the location you passed it is not next to the empty tile, then it will return none. So if it's next to the empty tile, it'll return you the location of that empty tile. If it's not next to it, then it will return none, rather. Swap tiles, this will basically take the thing from one index and put it into the other location. Take the index from one location in the tile grid and swap it into a different location. That's the cheater. We probably don't need this in our version of the game either.  And then this is actually the part we did already during the stream. So that's getting the touch point from the driver. If it actually got touched, if it's inside the tile grid, putting our new off by one fix, finding out which specific cell within the grid got touched. And we don't use that right now. Alt clicked, bunch of print statements. Look for the blank tile. Look for the blank tile at all of our neighbors. If we found it, then call swap tiles with it. Oh, so we do actually need that. And then sleep for half seconds. And then there's another small sleep down there, but that's all there is to it. Pretty straightforward program. Is there any documentation that describes how bindings are implemented in Cirque Python? What do you mean by bindings? Good question, yeah, I'm not sure either. In my best guess as to what that means is maybe the shared bindings. Like if you were making your own new part of the API. But that seems like a long shot possibly also, so I'm not sure. I will surely mess that up if I do try to say the first part of it. I do appreciate you though over there in Sweden. Great watching. Thank you, Axel Magnus over on YouTube there. Definitely appreciate you tuning in all the way from Sweden. That's actually, that's really cool. It's really cool to hear. Good night. I assume that that's probably translates to something like good night, I guess. If not, then I apologize for getting that one wrong, but if so, good night to you as well. And again, appreciate you tuning in. The way Python communicates with C. Okay, yeah, that is basically a shared binding. Basically how these modules like display are implemented, shared bindings and shared modules folder in the repo. Yeah, correct, yeah. I think I am not aware. Scott might be aware of more than I am certainly in terms of what exists and what doesn't. I am not aware, I'm trying to think, I'm not aware of any documentation that does specifically describe and document the way that shared bindings works all the way. So there's a visual. If you're a visual person, there is a visual, there is like a visual guide that Kmatch, I think. Kevin, member of the community, made a visual guide. I think it's in like a PDF or something. And it pulls in screenshots of the different parts of the code and it like highlights different things and then kind of like visually points you over to which other part of the code they match up with. So you'll see like C code in it and then something will be highlighted or circled with an arrow kind of like pointing over to the portion of the Python code or I think it's actually the docs, the Python docs, not the code itself, but it kind of like shows you what that part of the C code is responsible for in the docs. Looks like there is a little bit though. Yeah, thanks, thanks Tim. Good night to all, have a nice weekend. Yeah, thank you for watching Paul. Thank you for all the cool stuff you've made as well. And thank you and good night as well to you. I'll pull this up. I'm actually, I don't know that I've seen this page so this'll actually be interesting to get a look at this. I'm about to head out here pretty quick though. So let's see, common how. Adding IO support file layout. Okay, yeah, no, this is definitely, I did not realize this page exists. I don't think I've ever seen this page. Yeah, I should come back and read this even if it is outdated a bit. I mean, maybe I can update it a bit too. Potentially, like I'm still learning some of this stuff, but yeah, that is helpful. Nice. Extending to CircuitPython. Someone's learned guide. Oh, this I was actually just looking for this the other day too. So I'm glad you linked this. I was just saying the other day, I think I may have been on the stream, it'd be really cool if we had a guide that showed kind of like hello world of adding your own thing to CircuitPython. And that is like exactly what this is. That's awesome. I need to go through this better too. I am to the point where I can like add on to an existing thing and eventually get it working by just copy pasting parts of it and hacking it up. I'm not quite to the point where I can just write from scratch lots of this stuff. So actually this guide probably would help me get a lot further along that road. And this is called what now? This is called extending CircuitPython and introduction. Nice. I'm gonna definitely be in a book market over in Chrome because I do more of my normal browsing over in Chrome rather than Firefox. So let's do that. Boom. Done. Bookmarks. Gonna definitely take a look through that. Okay. Python objects are C-structs under the hood. Keep it real. Yep. Take it easy. Love the factory. Yep. Thanks for the question, Isaac Ben. Appreciate you hanging out and asking questions. CircuitPythonDev is the channel to ask about. Yep. This will copy the module. One module to start another. It'd be great to update both pages. Yeah. I may go over both with an eye towards modernizing them and updating them to the current. See if there's anything that's different in the repo like file path and any of that sort of stuff these days because it looks like it was a while ago. Yep. You're welcome. See Grover. Thanks for tuning out. We appreciate all of you watching. Appreciate everybody hanging out in the chat and stuff. Thank you again to Scott for the review and everything else you've done for CircuitPython, obviously. Thanks to Grover for the calibration thing. We used that thing again today, so appreciate that. Yeah, everybody else that was watching. Appreciate all of you. Honestly, love the factory. Who else? We had a ton of folks around today. To Shippu, Tammy. Thank you to all of you. NairDoc helped me out with a couple of things. Gordy G over in the YouTube. We had Beata over there in the YouTube as well. Thank you to you folks. American Buff, thank you to you as well. I will be back folks. If folks want to watch more CircuitPython stuff tomorrow morning at 10 a.m. central time. Sorry, I don't know the UTC time exactly or how that can verts. But if you look up central time and you convert 10 a.m. into your time zone, I will be back here streaming again, although I'll be on my own Twitch and my own YouTube rather than the ate a fruit one. I'll always drop links in the live broadcast chat, which is the Discord chat that is on the screen down below me there. So if you hang out there in the morning, I'll put the link over to Twitch and YouTube when I'm getting started. So check that out. We'll be working on something tomorrow. Not sure what yet, but we'll find something fun. Sherry, thank you very much. It's been very informative. That's awesome. I'm glad to hear that. Thanks Sherry. And yeah, have a good night everybody. I will catch you all.


Hi, I'm Dave Hanley, the co-founder of Banyan Branch and a new YGL for 2012. My background is varied in that I keep stepping in and out of business and into non-profits. I began my career working with microcredit banks in Latin America and Asia and left that to pursue a role in online media that led me to co-founding one of the largest independent social media agencies in the world. But I still spend time working in international development, spending time on the advisory board of Bitana, an incredible institution that's trying to take microlending into the education space in a scalable way, as well as working with a YGL initiative on water. It's great to be with this group. I have much to learn and excited about where it's going to take me. The next generation of leaders needs to be more innovative than the generation that came before it, which is a very high standard for us to meet. But with the growth in population that we've seen and the incredible growth and consumption that has come along with it of our resources, of our environmental resources, and of our economic resources, as we try to meet these demands, we need to be more innovative and we need to, also as a group of leaders, we need to break down these artificial barriers that we place between business and making the world a better and stronger place. That as we look at the long-term needs of growing healthy and successful businesses, those needs are not divergent from the needs of making the world a better and stronger place. And so it is incumbent upon us to have that broader vision and to have those longer term goals and always look with a vision of applying our ingenuity, not just creating new products and services, but also in applying it in terms of how we can make the world a better, more healthy, and stronger place for us all to live in together. This also creates a problem, though, which is if these young people find barriers, if they find a lack of opportunity, if they cannot control their own destinies because of economic, social, or political constraints, then we will see the greatest unrest that we've ever seen in the history of our world and it may prove to be cataclysmic among people and organizations that are trying to make the world better, but aren't. So it is incumbent upon the business leaders of the world, the political leaders of the world, the social leaders of the world, and the religious leaders of the world to allow this generation to shine and to become who they're meant to be, just great and good people. I think it's probably common among YGLs that they look at the list of people and all the great accomplishments and determine, obviously, I'm the one that they made a mistake on. I'm the one that perhaps shouldn't have been selected, but regardless, I'm lucky enough to be here. As a part of this community, what I bring is my ability to connect people together, that through my background in social media and my desires to connect disparate groups of people together so that they can create together and explore together will probably be the greatest thing that I can give, that in my passion for the world and my curiosity of in basically every subject. What I hope to get is a set of friendships that will last a long time, that as I meet people who have been great at what they've done, that perhaps over our careers we can work together to make the world a little better or make a little corner of the world a little better or join in creating and building something together. I'm hoping that it's, while it's hard for me at my age to look five years out, it seems like such a long time, but during this five-year tenure to do some great things, but also to join with these people that knowing that for the rest of our lives will be knit together through this experience is something of great excitement and interest to me.