 All right, hello everyone. Happy Friday. Let me give a few more things around here and stop some of the previews, and then we will dive on the road. I don't think they got roads in the ocean, right? One of the nice things about the ocean. A few nice things. I'm not big on the ocean. I'm scared of you. Anyway, this is neither here nor there. Okay, there we are. Hello, everyone. My name is Tim, and I go by FomeGuy on GitHub and Discord. This is the deep dive program. If you are new to this program, what we will be looking at primarily is stuff related to CircuitPython. This is the website for that project, circuitpython.org. You can head there to learn more if you have never heard of that before or don't know what it is. The high-level version, though, is that this is basically an implementation of Python that runs on tiny computers called microcontrollers. This is a microcontroller. There's a US quarter for size, so this is a pretty small little device, but it essentially has a whole computer in there. This one even has a screen on it and battery charging, so it has a couple extra capabilities. The idea is that we have an implementation of Python. It's running on this device, and we can just save our Python code to this device pretty much just like it was a thumb drive, and then it will execute our Python code for us. It can interact with the hardware peripherals that are connected to the microcontrollers. It can interact with the screen. It can interact with all of these IOPins along the sides here. It can interact with the battery, or it can be powered from the battery, I should say. You can plug in sensors or RGB lights or buzzers, beepers, buttons, pretty much any kind of like, electronical input or sensor or widget. You can connect up with these microcontrollers and then use Python code to control it. So that's kind of the high-level idea of what we are working on is CircuitPython related stuff. Again, circuitpython.org. This is the website where you can learn more, and then I must say thank you to Adafruit. CircuitPython is an open-source project, but Adafruit is the company that's paying the folks who work on CircuitPython. 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 pays us to work on the project to update libraries, to make new libraries, to write guides, to help foster the community around it, to run the meetings, all of these kinds of things. Adafruit is the company that is paying for that, so huge thanks to them. And if you would like to help support that open-source CircuitPython project, one of the ways you can do that is by purchasing hardware from Adafruit. They have all kinds of microcontroller devices, much like this one here, which is an Adafruit device. This is a Feather ESP32-S2-TFT. It has quite a long name, but that's the ESP32-S2-TFT. This has quickly become kind of like my go-to device for just randomly grabbing to test stuff out, because the feather form factor is nice. There are lots of feather wings, which can plug into feathers, although in this one I don't have the pins on it, so we wouldn't be able to do that. But lots of things are made to work with feathers. It has a stemma cable, so you can plug in any kind of stemma breakouts, and this one has a decently sized screen. It's not a huge screen like a pie portal or anything like that, but it's a big enough screen to be able to draw some stuff on and test some stuff out, so that's what this device is. You can buy one of those over at Adafruit if you like. If they're in stock, I didn't actually check the stock, so maybe they're not, and I apologize if not. Aside from the microcontrollers, they also have the sensors, the lights, the RGB lights, the buttons, the beepers, the buzzers, pretty much any kind of thing, again, that you can think of that you can hook up to those microcontrollers. Adafruit has got lots of that kind of stuff that you can purchase, so thank you to folks that make purchases from Adafruit again, because they are the ones primarily supporting the CircuitPython project financially. I want to say also, let's see here, how's it going, PaulSK? Happy Friday from Lisbon, nice. All Pauls represented and accounted for, as well as Radomir's, nice. How's it going, folks? How's it going in the YouTube over there, Evil Dave of Canada, and then Noradine? Unfortunately, I can't read this last message, but thanks for tuning in nonetheless. Paul Kutler, I think I got an early hug report for Paul Kutler. Thank you, Paul. During the, what was it, show and tell, Wednesday night programs like show and tell, Paul mentioned that Digikey has PicoWs in stock, which I missed the PicoW the first time around. So thank you, Paul, for mentioning that, and I jumped right on that Wednesday night, and I actually got a visit from the Digikey Ferry today with my PicoWs in there. So we'll get those out, we'll play with those at some point, maybe not on this stream, but thank you to Paul Kutler because I would not have one yet if it were not for you. And if anybody else is interested, Digikey is the place to be right now, 4800 of those things still in stock. So if you don't have a PicoW yet and you're looking to pick one up, you got some time, but maybe not much, because this was over 6000 just two days ago. So they are going still fairly quick. But head there if you want to get one of those. And like I said, we will play with that on a future stream. I'm excited to try out Jeff's build for that PicoW to start testing the Wi-Fi stuff, like with requests and things like that. I think that is, that has a lot of promise for kind of like small IoT projects and stuff. So I'm excited to try that out. But in this stream in particular, we're not going to get into there or we may, I guess, if there's time. But the truth is the first thing I want to look into is display IO related stuff. So if folks that have watched before probably know that I spend a fair amount of time in display IO lands, I like to play with, you know, the libraries and things that allow us to draw on these screens. And so that is what I'm going to be getting into first is a particular bug that I've noticed. I'll say relating to display IO. I don't know if it's, you know, I don't know where the bug is at. I know what the symptoms are. The symptoms are that bitmap labels don't draw on Blinka display IO. And so we're going to try to figure that out. We're going to put on our investigator hat today. We're going to try to figure out why you bitmap map labels not display on Blinka display IO. And then if we can, we're going to hopefully try to figure out a way to fix it, which will, with any luck, come shortly after figuring out why it's doing that. How's it going, Beata and DJ Devin. So that's where I'm at. And just to set the stage here, let's go to display text. And I'll show you what is not working right now. And then we'll start digging in, try to figure out what's wrong with it. Simple test, we can just take simple test for, so I'll start with label. So for folks that don't know display text, Adafruit Circle Python display text, this is the main library for making text with display IO. And there are two main classes, two main types of labels. One of them is just called label. That one was the first one to exist. So this one says from Adafruit display text import label, just label by itself. This is the original display text label. And then there is a newer one, which is called bitmap label, which has different behavior internally. But it's intended to have the same API, the same programming interface. So they are more or less meant to be interchangeable. But the bitmap one, it essentially stores the entire string inside a single bitmap, whereas the original one, the plain label, as it were, this one stores its string in a series of bitmaps, one for each glyph. So that's kind of the main difference. There's a good guide page actually with a illustration of this. Let me pull that up real fast. Types of labels. This page explains the different types of labels and shows a diagram that kind of lays out the difference between the two. So this is the original, you know, plain label. There is a tile grid and a bitmap for each glyph. And then there is a group which holds all those tile grids. This one is the bitmap label. There is a single bitmap, which holds all the glyphs together, a single tile grid, and that is inside a group still in the bitmap label. So these are the two main kinds of labels. And what we are running up against is that this one, which is the one that I tend to default to use, just because the way that it stores this stuff here is a little bit more efficient. It tends to take a little bit less RAM, especially if you have long strings. And so I tend to default to this one these days. But what I have noticed is that this one does not work on Blinka display I.O. I'll talk a little bit more about what Blinka display I.O. is as we dive in. But to start with, I just want to get the basics running and just like verify the issue on the latest versions of the libraries and all that stuff. Like maybe there's some chance that I just had an out-of-date version or something, maybe it's not actually broken. So that's the first thing we're going to do is just like make sure that what I think is broken is actually broken on the latest versions of everything. And so to illustrate that, I'm going to run this, which is the plain label simple test. This one is not the bitmap label one. This one is the plain label one. See which side do we want to do? Maybe that one on that side is the covered up. Am I covering that up? Not too bad. Maybe if we got there a little bit. And it's a little small. I guess we could zoom in there. You know, we're not going to be printing anything important there, so it doesn't matter if you can't read this. But it just says hello world because that's what's in the label. And then the bitmap label also has a simple test, which is pretty much almost the exact same code. The only difference is what it imports, because again the programming interface is intended to be the same so that they are interchangeable. So really all you need to do is import the other one and then use that as the one you create. And we still have hello world. So we just ran both of them on our circuit Python device, and both of them work the same. We got a little white hello world somewhere near the top left corner, and both of those did the exact same thing, which is perfect. That's what we want to happen. And if I switch back here, I'll let you see while it's live here, so we'll save and this will rerun, and now we're looking at the regular label. We can switch back and now we're looking at the bitmap label. So in circuit Python land on the microcontroller, everything is groovy. They both work the exact same. They're both showing their text all as well. But in Blinka display IO land, so for folks that might be newer or if you just don't know, Blinka display IO. Well, let's start with Blinka, I guess. Blinka is the circuit Python compatibility label layer. Let's go Blinka. Let's just go Blinka Adafruit, maybe. Adafruit GitHub. Just there, right? Yeah. Well, nope, not quite. But we want that one too. Blinka GitHub. There it is. So Adafruit Blinka is a project which is a circuit Python compatibility layer for Raspberry Pi and other single board computers. The idea is that you can install this library on your Raspberry Pi or your similar types of Linux single board computers. When you have this library installed, it will make it so that you can run code which was originally written for circuit Python to run on the microcontroller. Of course, a full PC like a Raspberry Pi is a much different kind of environment than a microcontroller. And so by default, like circuit Python code will not just run on a Raspberry Pi, but this compatibility layer makes it so that it will. So that's what this is about. It's about allowing you to run, you know, circuit Python code on your Raspberry Pi or your single board Linux computer. One more library, Adafruit Blinka display IO. This library works in conjunction with Blinka, so it is just another add-on for that compatibility layer. And this one is specifically for the display IO module. So this one allows you to run again on a Raspberry Pi or a single board computer. And this one allows you to use display IO specific circuit Python code and run it on that Raspberry Pi with an attached screen, like a spy or a I2C display. And so I have a Raspberry Pi here, quite a dusty screen, as you can see. There's nothing currently on the display, but this display is connected to the Raspberry Pi via spy. Some of these pins down here are the spy connection. And so this display is hooked up via spy. And with Blinka display IO, we are able to draw things on this display. So I already have a terminal over here, so I'm going to run, let's go cat simple test. Is this one used label or bitmap label? Regular label. Okay, so let's run simple test. So I already have Blinka display IO set up. We will probably reinstall it, like get a make sure we have the latest version of everything. We'll do that here in a minute. But let's run this one first real quick. Simple test. There it is. Now this is going to run. And so this is what the simple test looks like, or I think I actually modified it. It's usually pink and green. Mine's now blue and purple because I was messing around with something. But the important bit is that it has Hello World written right here. This Hello World is inside of a label, pretty much the exact same way as our simple test was just a minute ago. We create a label, we just put some text in it, we add it to the group, and therefore it gets shown on the display. So this one is currently using the normal layer, the standard label. But this one, bitmap label. Oops, I wanted to cat that. No, it's not LS, there we go cat. So this one is using bitmap label. If we try to run it, I found three IL bitmap, interesting. Ah, okay, I must have started troubleshooting this a bit because it looks like I set a background color like I was messing with some stuff. Interesting. Okay, let's instead of running that one actually, let's go back to the first one. Let's go, let me open this actually. That's not what it would have taken forever. Okay, it did actually get me closer though, which is nice. New window. Let me change this up a bit. This one I've already done some other kind of stuff inside. Let's get a, let's do, let's pare it down back to the actual simple test and make a file called troubleshoot bitmap label troubleshoot. I'm going to leave all the display setup, but then I'm going to get rid of all of everything else. So this will set up the display, it will create a group and it will show the group on the display. So we should now be able to add whatever we want into this group and then show it on the display. I'm going to change this to main group. I like main group better than splash personally. We can take this, we can do that and then the only difference is we don't want to use board.display. We just want to use, actually we don't even need this. We can just go main group.append text area and then we're going to want to do the import. Oh, we already have the import actually. Okay. Okay, so this one did not draw anything, but if we switch this over to regular label and rerun it and it will draw something. That's the theory at least. Oops. Okay. It's pretty small, but up in the corner there, there's a white hello world. Pretty much the same thing we saw on the microcontroller. Hi. So blink of display is for spy and I2C display. Is there another option for using the HDMI? Why yes, there is. There is another option. We'll get into that here in a bit as well. There is a sneak peek if you want to look ahead. There is a thing I created called blink of display IO pi game display. This project right here, this is intended to work with blink of display IO and it also works with the third party unrelated project called pi game. And what this does is it allows you to initialize this pie game display like this. And then you're going to be able to call like display.show the same way that you would on a built in display. And this is going to run on a PC. So this is made more to run on a PC or a Linux computer. I believe it does work on a Raspberry Pi. I'm not 100% sure. I haven't done a whole lot of gooey work on the pie itself like through its desktop through its HDMI. To the best of my knowledge, though, as long as you can run pi game on the Raspberry Pi, which I believe you can, then I think you should be able to use this to essentially create display IO programs that will go through the HDMI rather than a spy or an I2C bus. And we will be using this here in a few minutes. Mostly what I wanted to do was on the Raspberry Pi, verify that the thing I thought was wrong is actually wrong. And then I'm probably going to switch back to my PC just because it's more convenient to run over there. And so when I run on my PC, I'll be using that pi game display so that we can iterate more quickly and just try stuff out and see if we can figure out what's wrong with it. But as we can see here, I'll make this bigger. We should be able to just do a big scale or something right. Maybe even like we could go bigger if we put a new line here. Since it's on a Pi, does that mean Blinka can interface with PIL? PIL plus CircuPython sounds nice. So Blinka Display IO does use PIL for some stuff. So you could. Yeah, you could interface your CircuPython code essentially with PIL. Obviously, you would not be able to run that code on a microcontroller because there is no like CircuPython version of PIL. But if you're on a Raspberry Pi or a Linux PC, if you're using Blinka Display IO, then you're actually already using PIL to some extent. It uses PIL image objects to basically contain the image that will be drawn on the screen. I believe it's been a little while since I looked inside Blinka Display IO, but I'm pretty sure that's the way it works. And so you could do other stuff with PIL as well. Okay, so that's much bigger, much easier to see. It is still working. And if we switch back to bitmap label and we try it one more time, then what we're going to see is that it's not working anymore. Yeah, so it takes it a second to refresh there, but now we have no text. Interestingly, background color. So we're drawing our box, we're just not drawing our glyphs. Okay, so it's not that bitmap label just doesn't get shown at all. It is that the glyphs are not getting shown inside of it for some reason. Could be the cost for that. Does that mean PyGamer microcontroller game emulator for the PC someday? I would not say that it's impossible, but I don't know that it's a thing that I'd be able to make. If you mean like full-on emulator, like you could run Circuit Python code on that emulated device and then see the output of it, I think that's probably further off into the future. The thing that is closest to that right now is Wokwi. The thing I know of, I should say, that maybe there's something closer that I'm not aware of, but Wokwi is a microcontroller simulator and it has access for Circuit Python on a couple devices, I think. I don't remember exactly how to get to the Circuit Python part of it, though. There's MicroPython. Oops, I swear there's a Circuit Python one in here somewhere. What if we say Wokwi Circuit? This is a web application. It just runs in the browser and it simulates microcontrollers, including the Raspberry Pi Pico and a couple others. This project was made primarily more, I think, for the Arduino side of things, but it did eventually come to support MicroPython and it does now support Circuit Python for the Raspberry Pi Pico. You can run your code on here. This is the furthest along emulator or simulator that I'm aware of, but I believe the only chip they have is Raspberry Pi Pico. If this project ever implemented the SAMD51 as an emulator chip, then I think the Pi Gamer could exist inside of there and then potentially a layer could be built for DisplayIO as well. I don't know if or when that will actually happen, but I think those are probably the things that would, that would probably be the closest opportunity we have to a Pi Gamer simulator. The main thing I want to do real quick is just double-check that we're using the latest version of Blinka DisplayIO. How do you, is the status tell you your branch? Get it through main. Already up to date. Blinka DisplayIO is up to date. Display text. Resume is installed from, I thought we were years away from WebWorkflow, yet here we are. That's true. Yeah, WebWorkflow did come kind of quick once it was the thing at the forefront for sure. I guess it doesn't have the pip install here, maybe over here. Do I need an upgrade? I think I might need an upgrade, right? Because I already have it, probably. Already satisfied. Get it downloaded or anything. It's like this, right? Upgrade, 414. You know though, right? It doesn't, did it? I'm already up to date. 2 to 22.11. Okay, so that is the, that's the latest version. Okay. What is up with that? Is it like, um, maybe we should set the color? Four-gram color? I mean it should be white by default. It doesn't change when we change the color. We still have the same thing. So latest version Blinka DisplayIO, latest version DisplayText, and we're not getting anything. So now we are going to jump to the PC instead of the Raspberry Pi. I just wanted to verify on the Pi that it was actually the case that it wasn't working. Just to kind of rule out the fact that there could be anything specific to the Pi game display that would be actually causing it to be broken. One thing we want to do on the PC is also probably update Blinka DisplayIO. Let's show. I don't actually know the 723dev5. So 010.2. Blinka is 850. 010.2. We're good there, but Blinka is a little older. So let's install Blinka. I don't think should really factor into this, but it's always good to be testing with the most up-to-date stuff. So 850. So now we can do stuff like run these Pi game examples. Pi game display samples. Simple test. Someone uses label. We need to update platform detect also. But sometimes I will say sometimes this gets broken by like the fact that Blinka is not actually really intended to run on laptops. Blinka DisplayIO either. I happen to make it possible by adding this Pi game display to it, but it was never intended. So like occasionally either platform detect or Blinka or Blinka DisplayIO. One of those three things can get updated, and then it can stop working on the PC. And then we got to figure out why we're downgrade I guess would be the other option. But we were on 723dev5. Let's see, does this... We went back to that version? That version doesn't exist. Doesn't work either. That is clear. I must have had some super weird version of Blinka installed. It was like 723dev5. I wonder, does that mean like maybe I installed it from my local repo? Ah, there we are. Okay, 730 works. But 850 actually does not work right now on my laptop. This I think depends on your laptop, because platform detect is trying to figure out essentially what device it's running on, and more devices are getting at it all the time. And like if it doesn't recognize it, or if it does recognize it, but it's like the wrong thing or something, then it won't let you run. Like we get that error that we saw a minute ago. But I guess, yeah, we probably should try to get Blinka itself working again, huh? Instead of just testing all of this against Blinka 7.30, realistically we probably want to be back up to 850 or whatever the current release was. And then we probably want to go fix it, or wherever it's not working. Okay, this just doesn't matter which project. Weird. Is there a JavaScript-growing library that works like DisplayIO? Uh, not that works like DisplayIO. There is Canvas for JavaScript and HTML, which is a way to draw things, but does not quite really work the same as DisplayIO. It doesn't have groups, it doesn't have tile grids, kind of its own thing to an extent. Uh, all right. Let's get back to main, pull, and let's actually uninstall 320. Let's check platform detect also. Since the error we were getting was about a certain chip, something something not supported, 3.31.0. See, maybe we update that and it just starts working and be kind of nice. Then we're going to install it from my repo here instead of from pip. That way, like, I'll be able to make changes to my repo and then reinstall it and we'll get the latest version. Well, not the latest version, but the version that I changed under run. Okay, that is working. Okay. Is there like version? Can we check? I want to verify that we're actually running that version. Well, I guess here's what we can do is we could just uninstall it. Maybe I'll write one. That would be pretty sweet. I would totally be interested in JavaScript implementation of DisplayIO because you could use it to help learn DisplayIO if you don't have a microcontroller. Probably could code a translator, yeah, using canvas and CSS selectors. Yeah, I would agree. Yeah, I think it's definitely possible. You'd still have to do some conversion to JavaScript, but you could take a look inside Pygame Display or kind of the core bit of how it's basically just copying each pixel over one at a time. But you'd have to be kind of changing that over to be JavaScript-y. That part would be a bit difficult to module DigitalIO. Okay, so that definitely doesn't work when we uninstall Blinka, which means I think we could be pretty confident that when we run it, we're definitely running it with that version 8.50, in which case it does appear that updating PlatformDetect did allow this to work again. So I just had the old version of that. Once we updated that, now we're back to good to go. Now we could get back to LabelLand, which is to say .bitmap label import big label, just do that way. So we do have the same thing here, no text. And if we background color, we do see the background color, just not the glyphs. Oh, that's wrong. 2.22.3. 2.22.11. Okay. Now we have the latest version of DisplayText and we still have no text. So we are, I think, pretty confident at this point that there is some kind of problem somewhere that is not letting this work. It's always good to just double-check that stuff is actually not working when you think you saw it not working. The PyGame display implementation is cool. Nice. Thank you. I appreciate that. Catch up here. Highlighting text while reading is like great Scott, using highlighters on schematics. It's going to happen. Yeah, no, I highlight the text I look at a lot for sure. Whatever I'm reading, I tend to, it gets me into trouble sometimes, because like you can do this kind of like moving stuff around, which is never, ever, ever what I want to do. I never want to move text with that, but lots of programs allow it. And so then it's even worse if I have like just a small portion of my code, and then it's just like randomly somewhere else now. Because I was just trying to read. How's it going, Pamela? Appreciate you tuning in. Okay, let's get to main and update. And usually I just start with prints. I'm a lot like Scott in the fact that I'm a print debugger. See, I got to wrap my head back around on what goes on inside of here. So reset text text. Okay, so let's go just high level right here. Let's go print inside reset text. Text is text. I do the same thing with highlighting is read. Nice. Highlighters unite. Uninstall that. And then we're going to go install it from just pip install dot that will install it from the repo. Install it from the repo. Generate the wheels. Now it goes. We are does another right version, but that's okay. Okay, so we got inside reset text text is hello world. So reset text is getting called it is having the proper value for text. That rules out one potential cause of this empty string. We know it's not an empty string because we printed it out. We saw what was in it. This is interesting. What is this doing? So it has all these things inside parentheses. It's like a it's almost like a hard coded tuple, but then we're setting it equal to something. Okay, this is returning a tuple with a bunch of things. So that must be like, I don't know what the term in Python is in JavaScript though, this concept I think is similar concept is called spreading. Okay, so we're essentially declaring all these variables by calling this function and it's giving us back a certain number of values which we're storing in there. So that's okay. So the interesting thing like our box size, our box size seems okay because we are drawing the background color. Text is text hello world brings back memories of Baba is you. Nice. Yeah, I'm a big, I like hello world. I like sprinkling hello worlds in all kinds of places. Let's see here. Catch up. Problem is attempting to emulate a fast moving GitHub repo examples would likely be behind unless someone dedicates a major undertaking. It's like nightmare trying to keep up with the emulator. Depends on how the emulator is created. There's a Sphinx plugin that lets you run your examples as unit tests and it helps catch the breaking changes. Oh, interesting. Or she'd mock all display, but it still catch API changes. I didn't know that about Sphinx. The unit testing example stuff. Any pie wheels downloaded? What is a pie wheels? I can't tell you specifically what a pie wheel is. And my understanding is it's some kind of like compiled Python file. Essentially, though, when they say pie wheels downloads, effectively that means Blinka display IO copies downloaded or installed typically. Like when you run pip install, whatever, it is downloading a pie wheel, at least in the case of Blinka display IO. I don't know if all pip things behave the same or if pie wheel is like one option or whatever. But that is like essentially just the number of downloads is the way I'm that's my understanding at least. So I'm pretty sure our box is fine because we are getting the box with the background place text. So text if direction is not right to left else reverse the text basically if it's right to left then reverse the text. But should still just be text? What should still be hello world? Let's print that and let's make sure that we at least get to here and still have the proper value. I just install without uninstall or do I need to uninstall? Sure. Or maybe do I would I need to do upgrade? Well, it's not really going to be an upgrade either though if it's 00. That's really built. That's really installed. And we'll know if it didn't work because we won't get our new print. It didn't work then I'll uninstall it. Okay, yeah, we do. We get there. We got hello world. So far we're pretty deep in there and we're still looking okay. So our problems got to be most likely inside place text I suppose. Let's do one more like this to make sure we get you know out of place text make sure we're not maybe we're just getting stuck in there or something. Oh text is hello world. You're not saying sorry I misunderstood you a bit ago I thought you're talking about just hello world but text is hello world which is what we printed out I see after place text so we did get after that. So place text totally must be the thing responsible for actually copying the copying the glyphs. You know I just had a thought I think I might know what the problem is. This is probably using bitmap tools. It's not though actually it's not using bitmap tools interesting okay. So x start y start let's print those maybe we're like putting the glyphs outside the bounds or something. I feel like we got to be pretty close I think it's got to be something inside place text. My guess is that it's probably like perhaps a minor difference between c python and circuit python like maybe there's something being overridden or extended. We got x zero y eleven or inside place text we do still have our actual text x zero y eleven that seems reasonable I think this would be like somewhere right around here which feels like where the h would be if if it was getting drawn then we go left equals none right equals x start top equals bottom equals y start top equals bottom equals y start that's interesting line spacing equals self dot line spacing uh and all of these so I mean basically right here we're just going to print out everything we can and just like try to find like eventually we're going to find a variable that has a value that doesn't make sense uh that's I mean that's what I'm assuming at least so this will do a few more it will tell us left right top oops bottom also okay left is none right is zero top is 11 bottom is 11 line spacing is 1.25 I believe is the default we do get to every glyph inside of our for loop so we must be having trouble actually like putting it into the bitmap this is only for new line else we're going to go here we're not seeing this get printed we're not seeing this get printed so we should be going inside here I don't know glyph might not like I don't know if it has a two string that's going to give us anything useful I don't really know what glyph font dot get glyph I don't actually know what that returns you know what we should do is try one with custom font it just has a load font it doesn't have a get glyph glyph cache want fontio glyph want protocol get glyph returns a glyph glyph seems like a portion of a bitmap maybe we got a bunch of glyphs was not none's we got fontio glyph objects they seem to be different every time they're in different memory locations every time I guess we don't know that they're actually different I'm not sure what types of properties that would have on it self dot blitz when debugging print all the things yep this is the truth could those be anchor points which should have a range of zero to 1.0 uh I can't say unequivocally that they couldn't be that but I think it's unlikely that they are that uh because anchor point is part of the API for label but it's not really used internally for anything everything internally that I'm aware of is done with pixels x y coordinates with pixels we have a bitmap we have dx dy height shift x shift y tile index width on each of those glyphs so either our glyphs don't contain the actual data that represents the glyph visually or they do contain that but when we go to blit it into the bitmap we fail for some reason and I do think this is probably using bitmap tools internally but I guess it probably has a fallback not though maybe that could be our problem honestly I'm surprised it's not crashing anywhere surprised what it's doing is just not showing glyph dot dx my glyph bitmap that's just gonna be a bitmap object I guess we so so we could um can we get this out somehow can we get this and save it so that we could look inside of it and make sure it has the actual glyph how could we do that my glyph dot bitmap glyph dot bitmap I guess we could make a property on label that just stores one of these and then we could access that property from our code and put it on the display I will say speaking in PIL earlier PIL is nice when you're doing this kind of stuff because you could just save off this bitmap by itself as a as an image file and just look at it is the font just a kind of bitmap so I'm not a hundred percent sure how the fonts work my understanding is yes pretty much they have essentially a spreadsheet inside of them that is encoded in some way and we are like grabbing glyphs out of that spreadsheet based on their x y coordinates and their height and width but I don't know any more details than that and I also don't even know if that is accurate that's just the way it works inside my mind x1 y1 x2 y2 skip index with a glyph offset x if bitmap has built-in blit function then call it maybe it has this function but it doesn't work in blink of display inside blit same that's what I think about of it as well somehow spreadsheets with background color detection to make them transparent yeah it's like spreadsheet for a game yeah I think it is something something pretty much like that we have a lot of stuff printed this time okay about to call blit the x positions are moving 456 seems kind of large but I'm not sure oh and it said okay bitmap did have blit okay here's my guess right now is that maybe it has blit but it doesn't work or it's maybe just a stub or something I think that's my next guess let's go look so in so when we're running this our bitmap object is coming from blink of display IO that's here doing anything this is the one on the Raspberry Pi not actually what we want to change so I think that that function was probably written and just passed because it's part of the display IO API but it wasn't it just isn't implemented in blink of yet but it like it should be eventually right we want it to be but our issue is now that we have code that says has at our blit and then tries to call it but then that doesn't do anything so we we already have code that will do something when it doesn't have blit my suspicion is that that code will work so like here's what I'm thinking now is like let's get to main let's update it thinking if we comment out that empty blit function probably this just starts working interesting this knows the version why did I wonder why display text doesn't know the right version that's something to do with this it's kind of a rabbit full tangent or whatever but doesn't actually have pi project dot tunnel though now I think this prints yeah this prints bitmap did not have blit which means it uses the fallback code which means it works because it's actually doing something instead of just passing so we either need we is the font fixed width or variable uh if you mean specifically the font that I'm using right now I don't know it's the one that's default with blink of display but I don't know if it's built in I mean if it's a mono space or not off the top of my head I'm pretty sure that we have support for non-mono spaced one I could be wrong but I believe that's the case is that if you use like bitmap font the library and you load a bdf or a pcf file I believe that file can have a non-mono space font in it and I believe it should still work in circuit python I don't know for a fact if I've tested that I've certainly done lots of custom fonts but I don't know off the top of my head if any of them were we're not mono space specifically but to the best of my knowledge that does work like is possible so we either we have a couple options here we need this function to not exist so commenting it out makes it not exist which means that our display text code this returns false we go to here we do our own blit which this is basically just looping over x and y pixels copying pixels one at a time from one bitmap to the other that is basically what this is doing we either need this to not exist or we need it to be implemented and actually have code inside of it or we need to change display text to somehow know that it's empty but that seems very hard right how could python code know that the only thing inside of a function is pass I don't think it can know that could it we almost need like a function is stubbed or something like we need a way to indicate that we wrote the function signature but not the implementation yet therefore the rest of the code should pretend like doesn't exist so I wonder though I mean this is basically just the code for doing the blit right so maybe we could just take this put it in here and so these things are like this should have used find replace I still can use find replace and I still should but yet here we are now that we have way fewer left I'm just gonna do it hopefully I didn't mess any of those up because if we got any of those wrong that's definitely gonna break it we have source bitmap so in our case we are inside the bitmap object so one of our bitmaps is gonna be self but I think the one that's just called bitmap is gonna be self it is odd though okay we do yeah okay I was gonna say it is odd we don't use source bitmap but we do actually are the let's see here why do why have a non-functional blit function I cannot necessarily answer that for certain my guess is that my guess would be that somebody went through and added it because it exists in the circuit python API so they added a signature for it but did not add the implementation yet either they just didn't have time they didn't know how to make the implementation or they just had other stuff that was more important that's my guess though is that the signature was added with the intention being that ultimately we want to have an implementation for it but we don't have an implementation yet because like there's other stuff like this too right like this is another function but it doesn't actually do anything and I think kind of there's just stuff like that in blinko like if there's stuff that's not implemented yet sometimes it will have the function signature but just not the actual body not the implementation but that's my guess but I do not know can a sprite sheet have variable width sprites uh it depends what you mean by sprite sheet the concept of a sprite sheet just a bitmap with a bunch of smaller sprites inside of it certainly they could have sprites with different sizes I will say with circuit python uh or or more generally with display IO so whether you're using circuit python or blink a display IO um tile grid the tile grid class the tile grid class is one of the easiest ways to work with sprite sheets but that is actually a limitation of the tile grid class the tile grid class every tile has to be the same size so you can't have a sprite sheet with different size sprites if you use tile grid what you could use though is not use tile grid for your actual sprite logic of pulling the sprites out of your sheet but instead you could just use a bitmap object with your sprite sheet and then you could use bitmap dot blit to be cutting rectangles out of your sprite sheet copying them to somewhere else if you do that then you could certainly use different size sprites um you would have to write a little bit more of that code yourself probably that's doing the blitting and stuff like tile grid takes care of a lot of that for you but it is that is a limitation of tile grid all the tiles have to be the same size so but i'm pretty sure you could just skip tile grid and just use a bitmap with blitz yeah there we go bitmap did have blit and now it is actually working so now we want to go back to normal display text so what i'm going to do is go new branch omit this uh our fonts micro python objects and not unique to circuit python like palates and groups i do not know the answer to that one c grover not sure are those specific to blitz so a common name x1 etc won't break anything outside um i mean scoping should cause it to not break anything outside i'm pretty sure i mean they're definitely i mean i wouldn't say that they are like specific to blitz x1 y1 x2 y2 those are commonly used for any kind of geometry dealing with rectangles truthfully um but i don't think the way they're used inside of the bitmap object should break anything placeholders are a good way to not to forget about the feature forever that's true yeah it's in there so that it's like here's a commit add typing and missing cp functions nice okay so this looks like probably where it was added and it was just adding it's basically just fleshing out the apis to try to keep the apis similar the same ideally yeah but it's just not implemented yet but the good news is we did have an implementation that was already written in pure python and we dropped that inside the bitmap and now that's working so i think we are going to be good to go tiger does not like variable widths yeah correct it doesn't it has to be all tiles same size the the tile doesn't have to be square it could be like 20 by 10 but all the tiles do have to be the same size so all of them would be 20 by 10 only does the sprite have to be the same size they have to add up to be divisible have to be divisible by uh have to be divisible by the number in your grid the the number of tiles in your grid so your grid is like you know three by three tiles then it has to divide evenly to the whole bitmap basically you you can't have anything left over at the end or the beginning uh it's a wave toga to enforce it's actually working well that it's actually working with a spreadsheet that it can use i mean a real spreadsheet like there are plenty of real spreadsheets that tiger just doesn't support but it's a way for it to make sure that it actually is a spreadsheet that it supports just to say that it has all the tiles that are the exact same size because if the tiles were different sizes it's likely that it wouldn't divide evenly on the whole width how's it going johnny thanks for tuning in okay so now we're gonna go back to main we're gonna update oh we're gonna update that's not gonna do anything is it maybe we should update i think we did earlier though hopefully we did earlier yeah okay now we're gonna install main all those things that's what i meant it would be awesome if we could change tile grid one of these days to have multi uh different sizes that'd be pretty sweet but i suspect it would be kind of a lot of a change internally maybe it'd be worthwhile making a different object that's like a spreadsheet object that uses bitmaps more like how i was talking about with blit and then it can it needs a data file that tells it the position and size of each of the sprites but i think there's already a couple standard formats for that so we would pick one of the standards hopefully um and then maybe we could have it do that text texture atlas that's what some some frameworks i've heard call it texture atlas i'm not sure if that's like a general term or if that's specific to the things i've worked with it might be nice to have something like that supported in display oh okay we should be able to run this we no longer get any printing we took all of our prints out but we do still get text everything seems to be working i'm going to take the background color out so make sure that's not like somehow helping it work i don't i can't really fathom a way that would be the case but okay we're looking good okay so verdict is we need blit inside bitmap hopefully i was already up to date here on main you have dots and commit messages or i mean branch names maybe we shouldn't push it you can have emojis though right play dots fine but oh well uh from add bitmap blit uh add bitmap blit uh from data for main no track just have pre-commit yep failed black but but but but but now we succeed black and we push it let's say implementation thank goodness for this thing all right i pushed this branch too but that one we don't want to make pr from last part's not true but we're gonna is this autocomplete wow it does that's nice i didn't expect that to work uh-oh we detached our head it's not good thank you know there we are now we're good there too okay wait sorry let me catch up here an atlas is a spreadsheet that is different sizes sure that's a good name for it i've worked with texture atlases and games before displayed the atlas with kind of a visualizer and winder stat very handy for seeing your biggest textures that might be able to be optimized more be nice for cp game developers it's only uh that's the only scenario i see it being useful i mean it could be useful for um guis also graphical interfaces could create a spreadsheet that holds a bunch of different widget backgrounds or something tmbg did a song about the you know my wife likes tmbg did a song about what what did i say before uh or let me know what song it is definitely listen to it she'll be happy to know that i listen to something like that uh we're to see them we're to see them couple have i been a couple of times or have i only been once she's definitely seen him a bunch of times i think maybe i think i've been twice i think i want to see him twice it's pretty fun stuff it's not the music that i default to when i'm on my own but it is good stuff i do like it when i hear it they do have songs about a lot of weird things though i will say that there's like songs about numbers and on stanton opal all kinds of crazy songs are about like weirdly specific stuff what that's got to be wrong it can't fail that fast can it okay okay you folks saw the red x there right you everybody saw the red x this this is wrong sometimes the colors and the icons sometimes they get out of whack detached head oh okay song is mrs train that up for later when my head falls off i haven't seen a spreadsheet for a gooey that's large enough to be split off into an atlas spreadsheets by themselves are still fine for gooey's oh i see what you're saying you're saying atlas has like multiple spreadsheets that that organize the clock project well yeah the clock project its sprites are all the same size although i guess if they if we supported so with the clock project actually that would be a good place actually if we supported different sized i'm going to call them sprites but really what i mean is tile grid or if we had the spreadsheet object that supported different size sprites if we did have support for that the flip clock could use less memory and file size because the spreadsheets could be smaller because right now there is a fair amount of empty space in some of the sprites a quarter to a half or so of the sprites are over 50 empty space whereas if we could change them to different size sprites then we could just make the ones that have less stuff in them smaller therefore it's a smaller file size and less stuff in ram which would actually be pretty sweet because that project it does look cool but those files are pretty big honestly for circuit python devices the uh that the feather esp32 f2 that one is like the one that is pretty much the sweet spot because it has a lot of ram and a pretty decent sized file system so why did we fail here but we passed locally build docs okay two five two three this thing coughed up high or okay that's easy enough um it does seem odd that it was like that okay yeah this one has Ian failed black probably because i used the wrong quotes i used i think single quotes instead of double quotes yeah i like the wrong quotes i think both are fine but black decided that double quotes are what you use by default or quotes are the wrong quotes oh i wonder how they decided double quote outs on the outside that like straight up just a coin flip or is there some rationale that makes that better i wonder i will say i really really really like python's ability to put quotes inside of quotes i guess javascript does this too but like you know like if you want to use a single quote in your string then you can just make the quotes that rack wrap your string be double and vice versa so like if you want to use a double quote in your string then you can just use single quotes to wrap your string this is a feature of python that i very much enjoy because i come from java more like more of my background is with java and you can't do that in java single quotes have a different definition if you want to use a double quote in your string you have to escape it with a forward slash which you can do in python but it's kind of inconvenient especially if you have a lot of json that is inside of a string because it turns out json doesn't support single quotes for one thing and has a lot of quotes inside of it generally so then you end up with this weird json that has a bunch of backslashes everywhere or forward is that a forward slash i don't know which way the slash goes honestly i don't really know my forward slash from my backslash i know them as the one that's used for escaping things and the other one which pretty much isn't used for anything or is the other one the other one is the one that's used for URLs yeah and dividing that's pretty much how i know them one of them is used for escaping one of them is used for URLs and dividing but i do not know which one's front or back oh my goodness what have i done that changed the display it does what is this section stickers emojis i don't know how i open that or not sure where the x there's there surely there must have been an x button there somewhere hidden but backslash for escaping forward slash for getting to websites or comments i guess slash slash for comments what's the one that's in guns and roses no i might have got that wrong i don't even know if that's slash hopefully i didn't just wreck that joke by saying the wrong band i don't really know bands that well i'm paranoid i did i think i did didn't i is that actually slash is that slash you know is that right that's good now that i just explained the fact that i thought i got it wrong doesn't really change but that would have been pretty bad if i got that wrong i guess right backslash yeah that's true windows has the uh what i will refer to as the wrong slash for paths that's true and unfortunate if i may be honest it would be nice if windows had used the same slash as linux his URLs used the same slash as linux it's pretty much like retrieving files which is pretty much like reading files from the drive so be nice if they were all the same g and r okay but i didn't mess it up although i kind of revealed the fact that i don't actually know afterwards so i didn't save myself anything i'll say librarians i mean i would assume that it's pretty likely that melissa probably would be the one to um review this melissa is the main sort of driving force behind blinka display oh so oh and blinka as well actually so uh we shall see i'll do circuit path on librarians i think that she's in there anyway melissa so i think that should show up in her feed but we go a couple days or a week or something and nobody has reviewed it then i will uh look melissa in there as well take a look at it eventually backslash is for mod in some languages x slash and forward slash meme somewhere so we that's that's what i was intending to do was try to figure out why this was broken and fix it and i would say we have done that um normally i go about two hours that leaves us with about 15 minutes which is not a whole lot of time here's what i'm gonna here's what we're gonna do i'm gonna look at this for a little bit i don't know how far we're gonna get into it but i'm gonna look at this um this is a thing i call i i saw recently from a community member shoel tronics and i cannot resist display i o stuff so i happened to see this the other day and made a note of it and wanted to look into it i don't really know what all is in here yet i don't really know much about it other than it's a graphical interface and it works on circuit python but that much tells me that it's right at my alley we will see if we can get this to do something for us here see if we can see some of the stuff inside of it um what was it called display i o universal ui i use windows and i use forward slash and call the forward slash characters solidus really they have a way to let you do the forward slashes i haven't i haven't used windows for a while i bailed after seven i never did update to 10 and i got a Linux computer for my next computer after that called my lower board problem user error had them wired up wrong working fine now sweet the lower stuff there's a lot of details that go into it i have uh i've probably made similar mistakes to you in the past of like not getting the setup right and then wondering why the messages aren't going through json is so different to edit when url it had to change on windows url uh way to the other slash json was so different to edit wired up gpio to irq instead of reset ah okay yeah so it couldn't reset the laura module it was just flipping the irq pin yep you customize your terminal ah okay i did you i used a thing called sigwin which is some kind of like third party terminal um interesting interesting okay so we have like a have like a widget class which it seems like okay and then we extend so we have text widget okay so widget is like our base class we have text widget we have icon widget graphics widget a clue i mean i have a clue but it's not here on my desk with me gooey toolbar widget gooey dot update display we should be able to make this work you don't need any of this because the display is built in we do that already got import board i think that should work oh uh i know that and then of course i don't have gooey here either yet so let me copy that over i'm gooey oh gooey is here i see we will need the library too though right we don't have the library yet ultimate power shell prompt with oh my posh oh my posh usl is pretty nice uninstalled at chasing down a bug just to find out wsl isn't even remotely close to causing the bug but i was desperate at a circuit that would reset every time i changed one pin to zero turns out there's a solder bridge to the reset sigiline gives you the bin utils and bash shell yeah that's i remember that it gave me basically the basic bash stuff which would then let you use some scripts that were made for linux as long as they didn't use anything too crazy uh sholtronics edition is pretty great just going on what i've seen in your streams yeah i'm pretty stoked i think we'll probably spend another stream at some point i don't know if it'll be tomorrow uh or maybe next week but i think at some point we'll spend a stream diving a little further into this and playing with it i'll get my clue out and uh we can run it on blue desktop and raspberry pi just kind of see the the different stuff because from what i understand this is supposed to be a ui library that is focused on being cross supporting and i'm always sucker for a ui library or sure we might be out of space that should be that should be enough probably hopefully have to see the best of us yeah hardware is an interesting thing like my whole background is more with software than hardware and the idea that like your software breaks because a pin is is touching another pin like that adds a whole new layer of uh of troubleshooting okay display shapes being able to write programs that affect like physical stuff in the real world though is really what draws me to circuit python too so while it certainly does make troubleshooting a lot different nice it's also kind of like the main draw right like as a as a person coming from programming the fact that i can now write a program that interacts with the physical world that is just like the coolest thing to me is really the thing that hooked me into circuit python this one basically just updates the time now one thing i don't know there anything besides the label there because it calls this whoa whoops what are we doing we don't want to do that stop what are we doing do that it calls um it calls it a toolbar that set value toolbar widget is a text widget okay interesting okay so we got the basics running we got kind of the simple test running with our label that is updating over time um and speaking of time we are pretty much at time for this program so yeah i will dig into this again this was sholtronics library uh if anybody is interested it is here on github i'll drop the link into the discord sholtronics display i o universal ui um i will probably dive deeper into this in a future stream but i'm glad we got to this point at least like got it displaying and updating that seems like a decent chunk of the battle so we are there we'll look at that in a future stream uh thank you everybody for watching thanks for uh everybody who is chatting along and offering suggestions and asking questions and just hanging out with us in the chats on discord and youtube um thanks to you folks like this is kind of one of the one of the best parts of my week certainly that i looked look forward to all week um and a lot of it is just because i get to hang out with you folks who come and watch along and and hang out in the chat so uh thank you for that i appreciate all of you um appreciate everybody who's watching even if you're not in the chat as well that's awesome too um i'll be back tomorrow at 10 a.m central time for my next stream um i don't know exactly what i'll work on maybe it'll be this maybe will be something else depends on what we're feeling in the morning um but that's when i'll be back next 10 a.m central time tomorrow that one will be on my own channel rather than the aida fruit channel and i'll drop links in the um discord when i am about to get started so if you can just uh if you're interested in watching along tomorrow you can head to the same discord we're in now the live broadcast chat uh and i'll put the links in there when i'm getting ready to start up the stream um so yes thank you again to everybody for watching thank you again to aida fruit for sponsoring the folks who work on circuit python uh thank you to all the members of the circuit python python community for just being awesome and um like honestly it's just one of the coolest like communities to be a part of because pretty much everybody's cool so thank you everybody for uh being involved and being cool uh that's gonna be it for now i hope everybody has a good night and a good friday uh good weekend all that stuff hang out do some fun stuff and