 for John Park's workshop, right? Check in the chats over on our Discord and our YouTube. So thanks for stopping by. If you're somewhere like Twitch and you're wondering, where is the chat happening? Or maybe I'm on Facebook. I got Facebook streaming again today. I fixed a setting. Where's the chat? Well, I would say go on over to adafruit.it slash Discord and look for the live broadcast chat channel. It looks like that right there. You can see a bunch of different channels. We have picked that one, the live broadcast chat. And that's where people are hanging out for the show. So thank you all. Yeah, vidkerricks asks over in YouTube, why does my message always disappear? These are not, though. You said at least I saw that one. Yeah, I don't know why messages were disappearing. That's a good question. Let's see. Hello, by the way, to Davo Dessa, Johnny Bergdahl, also in the YouTube chat. Thanks for stopping by. Hi, Dibba Dog and C Grover and Thin Man, and Yanisku7. Thank you for dropping by. Let's see. What have we got going on today? I have a few things. Let's break it down. I've got a coupon code for you to use if you want to go buy some stuff over in the Adafruit Store. I do not have a product pick of the week video to play this week because I was out on Tuesday, but I'll be back with a new one next Tuesday. So please come on by for that. We've got a Circuit Python parsec in our continuing series on the Circuit Playground Library. We're almost ready to wrap that up. We just got, I think, two left. And then we'll have exhausted the Circuit Playground Library. But hopefully, if you haven't used it before, you've gained some cool insights on how it works. I've got a couple of project updates and a little demo of one in process involving some of these video game controller things that I was doing. What else? I have something else that I'm forgetting. Oh, I've got a little 3D model, 3D print, DIY espresso related tool thing I wanted to show. So we'll be looking at that, too. But first off, I'll give you this. This is a coupon code that you can use today until the end of the day. It's pressurewasher, pressure-washer, pressurewasher. That will get you 10% off over in the Adafruit Store. So go look for some stuff. You can jump right on over here, adafruit.com. And then find some things. Throw them in your cart as long as they're physical goods made of atoms and are not just software gift certificates or subscriptions, but are actual physical things. Like, let's say you want this really cool looking USB cable. This is a new USB cable that I believe lights up to tell you which, I don't know, it's got a display, right? Yeah, we're not seeing it on here. I think it's, there it is. It's got a little display that shows you the current usage and maybe some other info. I don't have one. I haven't tried it out yet. But let's see if you want to get that. You want to get 10% off. You could go ahead and use that coupon code right there, pressurewasher, on your way out, and you will get 10% off. Also, if you want to get free stuff, and who doesn't, go to adafruit.com slash free. And that will tell you about the deals we've got. So if you spend $99 or more on your order, you'll get a free PCB coaster with the gold Adafruit logo. It's an aluminum coaster with a, I guess it's like a silk screen kind of painted top and then copper. So it's made by a PCB manufacturer. I think this might be JLCPCB who makes these. But rather than on a fiberglass substrate, it's on an aluminum substrate. Also comes with some little rubber bumper feet. So spend $99 in the store, and you'll get that coaster for free. If you spend $149 or more, you'll get a free KB2040 keyboard microcontroller board, perfect for keyboard projects, macropad projects, and game controller projects, in fact. And you'll get the coaster. If you spend $199 or more, you'll get free UPS ground shipping in the continental United States and the KB2040, and the coaster. And if you go all the way up to the $299 level or more, you're going to get a free brand spanking new Metro M7, the hottest new board, Metro M7 right there, and the ground shipping, and the KB2040, and the coaster. So those stack up. You can get them all. So go check that out, and like I'm saying, don't forget to use that coupon code right there, and you'll get yourself a nice discount on the way out. Let's see. What else did I want to say? Yeah, so I've got a show that's on Tuesdays. It didn't happen this Tuesday because I was out, but that's the show right there, JP's product pick of the week. So come on by on Tuesday of next week, and I will have a new product pick. I will have a deep, deep discount on it, good just during the show. You can tune in, watch the show, or at least glance at it, and see if you're interested in what you can get for a deep discount. I think it'll be 50% off. Throw it in your cart. Buy it. No coupon code needed for that. And buy it before the end of the show, and you'll get your discount. Hey, Jeff Nash. How you doing? Nice to see you. Halloween is near. Hope you have something brewing. I bet you do. Jeff, I haven't heard from you in a long time. Nice to see you in the chat here. Yeah, Jeff is a big Halloween haunt guy. Yeah, I'm going to have some, I think I'll be doing, in fact, some product picks that are Halloween related. And I need to, I'm way behind. I need to figure out what I'm building. I know the Reese Brothers have some cool tombstone stuff they've done, but I got to figure out what I'm doing. We put up some of our decorations already. I changed the Wi-Fi light bulb on the front porch to kind of orange, so I hope that counts, get people in the mood. Southern California is starting to feel somewhat autumnal, so that's nice. So hey, Marie Meyer. Greetings from Pasadena, you say hello. Thanks for joining us today. So what else? Next up, something I do have for today, which is going to be our Circuit Python Parsec. So check it out. OK, so let me get set up here. Here we go. For the Circuit Python Parsec today, I wanted to show you how you can play a wave file on the Circuit Playground Express or the Circuit Playground Blufruit inside of the Circuit Playground Library, which gives us these really high level commands that are very consistent and easy to use. So in this case, you can see I've got a library and importing. That's the Adafruit Circuit Playground Library, importing it as CP. And then the first thing I do is I play a wave file with this simple command, cp.playfile, and then the name of a wave file that's sitting on the flash storage of the device. So that's what happens when this starts up, and I'll demonstrate that in a second to you. In fact, let me turn up a microphone so you'll be able to hear it. And I'm going to turn off this HVAC, because I think that might get picked up by that mic. Then in the main loop of the program, I am checking for button presses and a switch to be thrown. So you can see here, if CP button A, that's the button on the left, gets pressed, then depending on the state of the little toggle switch, we play either this one file, BP Box Wave, or this other one, Triode Drama Wave. And the B button always just plays this deskup.wave. So what I'm going to do is I'm going to restart the board. I'm just going to press Reset. And you can hear it did a little sort of Game Boy startup sound. And now I'm going to press the A button. I got a little file there called BP Box. Now I'm going to switch the switch to the right. And when I press the same button, I'm playing this other wave file, Triode Drama. And then the B button here always plays that one little bleepy file. And that is how you can play wave files right on the Circuit Playground Express or Circuit Playground Blue Fruit inside of Circuit Python using the Circuit Playground Library's play file command. And that is your Circuit Python Parsec. Yes, Circuit Python. Thank you so much, Paul Cutler. My mic isn't on. Too many things. All right. What was I saying? Oh, OK. So you can see the code that I'm using. What you can't see is the drive. But the CircuitPy drive that shows up with the Circuit Playground Blue Fruit there, it's just like a thumb drive. And I've dragged some wave files onto there. We have a bunch of learn guides that show you how to use and prepare wave files or MP3 files for other projects. But usually, there are these mono instead of stereo. It gives us half the size. And we're just playing it over this tiny little onboard speaker. So it's just fine. 22K 16-bit file works great. And you can use Audacity. In fact, there's now a web-based Audacity. In fact, let's look that up. I forgot. I wanted to share this. This is pretty cool. So let me go to Audacity Web Browser. Wave Assetty. Check this out. This is Audacity running in the web browser. So if you have ever needed to do any sort of sound editing or sound conversions, most of our guides have directed you to download the open-source-free Audacity for your operating system and then use it to do whatever you need to. In fact, on this one, let's see if I can remember how to. No, I can't. I don't use it myself. I use a different program. But there is a mono. You can turn stereo to mono. This comes with some track on here. So you can turn stereo to mono right here. And then you can export it using the frame rate that you want or the file specifications that you need that we have listed. So pretty cool. Go check this out. If you've ever needed to do audio stuff and didn't want to download a program, now you can do it right in the web browser. I don't know what this file is. Let's play it. Let's see. Just a little demo file there. But this seems to have most of the features. I don't know if you can use VST plugins and things like that. But it has most of the features that you would need to do some compression, noise reduction, reverb, pitch shifting, all of that kind of stuff. So go check out Waveacity, W-A-V-A-C-I-T-Y dot com. And that does it for that. So let's see. Next up, let me switch windows here. I wanted to show you this really cool espresso tool that I built based on a file I downloaded. There's a lot of these tools for people with 3D printers and espresso machines or other coffee brewing methods who want to build little tools and hacks and things to help with their process. I don't have my espresso machine in here. I actually forgot to also bring a portafilter so you can't really see this in action too well. But here's the tool. You can see it looks kind of like a little brush, little 3D printed handle there. And these are actually little spring steel needles. And I'll switch over to this down-shooter view so you can see this a little better one second. How about that? No, let's do this. There we go, big view. I'll just put a little. So there you can see this is tiny little flexible spring steel needles, which have been blunted, which you can use to, there's a technique in espresso making that is used to get the most even distribution of the coffee grounds in the portafilter basket, the thing that you tamp down and then put in to push the high pressure water through. And you want it to be as even as possible so you don't get channeling where water goes through the path of least resistance. So this technique called the Weiss distribution technique has existed for maybe a decade or so. Initially, people were using toothpicks or bamboo skewers, but people realized the smaller the needles, the better. So someone hit upon the idea of, hey, what about acupuncture needles? You can get them very inexpensively. They're used, also I know by some people in 3D printing to clean their nozzles out. So I bought 100 of them for $8 shipped Hafa Ali Express. This is what they look like when you buy them. You get, I believe it's 10 needles in a little pouch. If you go on Amazon, you'll find some people selling just this little pack of like 10 needles for about $10, which is fine. That's all you need, but I decided why not get a bazillion of them for cheap, which is fun. These are ostensibly hermetically sealed and sterile. And you can see it's a tiny little, very sharp needle. It's kind of useful for some other stuff. And it also comes with a little tube for administering the needle if you're actually using it for acupressure or acupuncture, I should say. And so what all I did was took them to a bench grinder and ground the tips down. And then this 3D printed file here you can see is a little handle and a back end of the handle, front end threads into the other. And there are some little holes. Let me see if we can see them. Oh, that's a holder for it. Can we see those? I don't have a 3D viewer open that you can see, unfortunately. But I'm not going to unscrew this because it's actually very snugly on there. But just trust me, it looks like a little salt shaker initially. There's 10 holes in there, 9 holes in there. And you just push the needles through from the back and then cap that right there. So that is the little, let me hide this one away so I don't poke myself, the little coffee tool I just made. And what I may do is there's a few other tools that are pretty cool and useful. And I may do a demo of some of those and get my machine in here so that you can see the whole thing in action. I've done a bunch of coffee projects over the years, and I thought this would be a fun one to show. In the chat, someone said, not sure. I would trust AliExpress acupuncture needles inside my body? Yeah, I concur. I mean, I'm sure. Actually, these were made in Korea, it looks like. I don't know what, I'm sure some of these are made and sold through what we'd consider sort of more trusted channels, and then happen to also be sold on AliExpress. It's sometimes a crapshoot, but that is right. These are really, really useful for a lot of things because they're high quality, spring steel, very sharp. And the end you can see has that little sort of thicker wound spring handle on the back of it. Gary T says, these would be great for roasting tiny, tiny marshmallows. I love that. Yeah, those would be a pretty good prop for something very tiny, smaller than a LEGO minifig. The other thing I've been using them for, actually, this is like a hack upon a hack, but I have a mug warmer that you can put your coffee mug, tea, whatever, something you want to keep warm. That is just like one of these $10 ones off of Amazon that's kind of highly unsafe. It's just a heating coil, plugs into AC, and there's a little sort of dead man switch. If the weight of the mug is enough, it presses down, clicks the switch, and then it heats the thing. And it works pretty well. What it also works really nicely for is candles. If you don't want to burn a candle, but instead melt it, which makes the candle last a lot longer, you also don't have an open flame, you can use that. But what happens is after a couple of hours, the candle is so melted that the wick often just kind of floats off into oblivion. And then when you want to let it cool again, if you do want to use that wick to burn it the normal way, you kind of have to center it and hold it and let it cool and prop it up with clothespins. So what I've started doing is actually spearing two of these acupuncture needles through the wick while it's cool, because then you get some resistance. And that's wide enough for the glass that the candle sits in. And that centers the wick even when it's fully melted. It's not going anywhere. So far, when you've got a hammer, everything looks like a nail, this is my new hammer, is hundreds of acupuncture needles for $8. So be on the lookout for lots and lots of acupuncture needle hacks here on John Park's workshop. All right, let's see, what else have we got? Questions, does he monitor this chat or only discord? Jeff Gortah Towsky, I do keep an eye on this one as well. One of the benefits of using Discord, if you can, going to our Discord server is that it's persistent. Whereas this YouTube chat kind of goes away or isn't active, it'll still be attached to the re-streamed video when the video gets reposted on its own automatically. You will still see this chat, but people can't go in and answer questions on it. Okay, let's see, makes me want another coffee, David Esses says yes, yes, in fact. It works well, I've been happy with using this actually. The other thing I'm going to print actually, so if you imagine, this is your portafilter, this roll of gaff tape, it's got coffee grounds in it and you are stirring it up and essentially fluffing it up, removing clumps and evenly distributing it as well as possible. It does kind of fluff up enough that it wants to spill over the edges, so another popular tool is a dosing funnel and it's a popular one to 3D print as well, sometimes with little magnets and it's just a shallow funnel a little wider than the portafilter, but it keeps the grounds from flying out the sides. So it may make one of those as well. In fact, let's, I'll show you. Thingiverse is full of these dosing funnel. Some are huge meant for like pouring into, there's a green one there that kind of shows the idea behind it and you can get them with different sizes for like a 58 millimeter basket, which is a standard or 52, which is some of the more home machine ones, uses a smaller one. So yeah, dosing funnel, that'll probably be next. Keep an eye out for that. All right, that was what I want to show you with that 3D printed thing. Next up, one last mention I wanted to make of the Synthio Learn Guide, Synthio Fundamentals Learn Guide. Let me switch back over to this browser here. I think this is published. So if it's not, let me know, but that should be, yeah, it looks like that's published. So one change I made from last week and prior was I had been using a Qtie Pi with the audio BFF connected as the I2S amplifier. And Lamour mentioned to me, hey, since you started that project, we actually came out with the Prop Maker Feather, which has everything you need to do Synthio with zero soldering. With the BFF and the Qtie Pi, we had to solder header pins and put them together. With this, there are screw terminal blocks that you can screw the 4-ohm speaker into and the I2S amplifier is built right on board. So it actually simplified even further the process of putting this together. And so I updated all the code to work with this example, but I left in commented out code for if you wanna just use a PWM and an RC circuit on most any microcontroller that has a PWM pin available as well as the Qtie Pi since I had recorded those videos with that. So if you take a look at these simple Synthio examples, all this code is now checked in on our GitHub so it's easier to maintain. I had just cut and pasted some stuff before I'd finalized it before, but now this is all adapted to use with the Prop Maker so this picks the proper pins, which are just board based pins are part of the board definition, but I do still have in there the pin numbers if you wanna use the audio BFF or the AMP BFF on a Qtie Pi or if you're gonna use PWM, then you'll just pick kind of any pin you want. This one's based on a Pico Raspberry Pi Pico with the GPIO pin 10 just happens to be picked there. And that was based on Todd Kurt's original examples, which all this code is. So that's ready to go. All my videos there show the little Qtie Pi, but you can do it even easier now with your Prop Maker Feather, so go check that out. All right, next up, I called today's episode Power Wash and remember, there's your coupon code, Pressure Washer. What's all this about? What's going on? So there's this game. It's called Power Wash Simulator and it is exactly what it sounds like. It is a game in which you run a small business cleaning up dirty stuff, vehicles, buildings, playgrounds, you name it, a train. You're just making money with your business, upgrading your gear and then spending hours and hours power washing with a Pressure Washer and water. The game is fantastic. I just got it recently. I've known about it for a while, but I just started playing it and I absolutely love it. And one of the things I realized is that it is a game that could really benefit from a better controller, a simulation of the actual process of using your Pressure Washer. So that's what I'm after. That's what I'm going for. So let me first just show you, let's jump over to, oh no, that camera went off, did it? Hold on, let me clean up the, what's going on here? If I can get it back. Here it is. So you can see there, the monitor that I have on the side there is a HDMI out from that laptop, or Windows gaming laptop. This game is only on Windows, which is one of the reasons I hadn't played it until recently, because I didn't have a good Windows machine. But I got a decent gaming laptop, partly for this purpose, as well as some other games and things. Oh yeah, Mars Rover, any SKU-7s played this game. There's a bonus where you can go clean up, on Mars you go clean up the Mars Rover, which is great. As well as a mysterious little hatch that goes under the ground. So what I'm going to do is I'm going to jump over there and show you the basics of this game and how it works, and then how I'm thinking about doing a control scheme for it. So let me, let me show you just with, I'll just use the, this is the worst possible way, but I'll just use the trackpad. Let's go back, restart job. Okay, so here is, this is actually the first level you do in the game if you're playing in career mode, which is cleaning up this dirty van. This is going to be your pressure washer business van. So just mouse and keyboard controls with how I have it set up or trackpad in this case. And what you do is click and clean, and you can see we've got a couple of modes we can use here. You can move the camera with the sprayer running or you can go into this kind of nice aim mode, which is a lot easier, I think, especially for spectators to look at and not get nauseous. You can also change the orientation of your nozzle if you want to do sweeping side to side kind of stuff. So what I'll do is try to control that with a microcontroller. So the first thing I tested with this, and I don't even think I'll show this because it's just, it's not satisfying, it's not what I want. First thing I showed it with, or I tested it with is a Clue board, which is the NRF 52840 chip on there. So you could do this with Bluetooth. For my purposes, we'll just connect over USB. It kind of makes more sense for this, like a pressure washer was coming out the back. But this has a accelerometer in it and it works pretty well using this tilt here. And I'm gonna get all of these, I can't remember which one this considers X, Y, and Z, and what we would consider yaw, pitch, and roll, or heading, roll, pitch. I'll have to get that straight for the controller or sensor I'm talking about when I write up a guide for this, but basic idea is tilting up and down with this works pretty well controlling USB HID mouse. And so this motion here up and down of that nozzle, we can control with a microcontroller, oh, there we go, something was in my way. But to do sweeping side by side to side, if you imagine holding your pressure washer, you basically wanna turn aiming side to side, not tilting, which is rolling rather. So with this, basically to get X motion on the mouse, you roll, which is kind of weird, that's not really what we wanna do. So I decided, and DJ Devon three absolutely nailed it, this is gonna be a nine doff project, a nine degree of freedom project. And so what we'll use for this is I've got a BNO-055, BNO-055 sensor, and I'll, let me bring on a, a little down shooter for a second so you can see this. So I've got this breakout board right here. Let me see if I can focus on there. Okay, so there you can see this is the BNO-055. And so this is sort of one of these sensor fusion kind of packages, it is really cool because what it has on it is an accelerometer, a magnetometer, a gyroscope, and then some other things. But with those three, it's got like temperature and maybe something else. But with those three, this actually has a little, I think it's a SAM-D21 or sometimes, some type of Cortex-M0 microcontroller built into the package that does the sensor fusion of all of those things. So if we know gyro and accelerometer and magnetometer info, we can, or they can on this chip, do the fusion of that sensor data to give us actual rotation in space. And so we can get heading, which is what we'll call this one. We can get heading, we can get roll, we can get pitch without doing all that math ourselves. This is complex stuff. I would never be able to pull it off myself. I would just be trying to implement other algorithms or code that I found. But thankfully, the BNO-055 does that sensor fusion for you, which is really cool. So to see this in action, let me, I'll, first thing I'll do is try to calibrate this. And this is the part I don't really have. My code is not trying to help me in this. So for now, it is doing okay, but I'm not storing calibration data. And so I'm having to calibrate it every time, but we'll get to that. So let me, let me start off by showing you what this calibration process looks like. Sorry, get the focus there again. Okay, so what I'm gonna do is I've got a QT-PI M0. This is an I square C stem of QT board. So what I'm gonna do is plug in the QT-PI. You're gonna see a couple things. One, my game is going crazy because it now is receiving mouse X and Y data off of this board, and this board is not yet calibrated. So this board, when it starts up, automatically starts to calibrate the accelerometer, the magnetometer, and the gyro. And in fact, some of these need a helping hand. So to calibrate the magnetometer, we wanna move this in a figure eight pattern a number of times and hopefully not near anything metal that's blocking it. I may actually have to remove it from this little aluminum board that may be a problem for the magnetometer, I'm not sure yet. So that is step kind of one of the manual calibration. And the next thing we'll do is calibrate the, I'm not sure if this is the accelerometer or the gyro or both, but what I'm gonna do is hold it for a few seconds on each face of the imaginary cube. And you can actually moving slowly between them helps. So there is a sort of confidence rating value that you can spit out and look at while you're doing this that goes everywhere anywhere from zero to three on each of the calibration axes or parameters for the different sensors on here. So I am gonna give it essentially all the faces of a cube. Now ideally what I'll do is export that data. I believe it's maybe as a JSON file. And then just read that on startup for this particular board as long as I don't change like get in front of a big CRT TV or something that I'm actually kind of likely to do or something else with a big magnet that could throw things off. Okay, so now this should be stable. So what I'm gonna do is I'm gonna point just for expediency using the track pad but now you can see, okay, I don't know why it's a little off, a little goofy angle here but I've essentially now got it stable and steady. Let me move this so you can see it centered. And if you're looking at the game there I can move side to side by twisting. So if I hold that in my hands I can point by moving side to side. And oh no, what happened to that camera? That camera's overheating or something. And I can tilt, I'm gonna switch. Let me see if I can just point my laptop screen into this camera here. Okay, so let's start that again. Okay, so here I'm holding this pretty steady and now you can see I should be able to and I don't have any buttons mapped to this yet for turning on the water but you can see now I can move or even better switch to this mode here where we're not, so not bad. And this was pretty quick workout. You can see I just got the hubcap entirely clean so that flashed, right? You've got different pressure nozzles that you can do with different angles that give you more power. You've also got like soap attachments and things like that. But what I wanna do is get this thing, if I can get this thing behaving well enough I'd like to mount it into some sort of simulated pressure washer nozzle. I don't know if that'll be a squirt gun or a 3D printed thing or what. And maybe add some control to it. So you've usually got either the WASD keys to navigate around and you can do coordinated turns that way. Oh, look at all this mud. This is not gonna just come off with this. Oh yeah it is, look at that. You can also crouch down. So what I'm thinking is to actually get my movement happening I'm gonna see if I can connect up our little I-square-C Stem-a-Q-T We-Chuck adapter and then I'll be able to in my left hand and maybe I'll also mount that on the nozzle have a thumb stick and that actually also gives us I think a pair of buttons underneath it. There's a C and a Z button. So I may be able to map that stuff to do what we need for a bunch of the functions in here. We may even be able to use two of those if we need to pick up more buttons or we'll see there's a bunch of options there but for now I'm really pleased with this is pretty stable here. I can probably get this speed up right now. It's lagging but I think that's just I have I think some delays actually in the code right now because of how I was testing it. So if we switch that view there we can just imagine we're pointing pointing the nozzle at the van here and cleaning it and that is just satisfying and fun. Crab walk over here. Yeah. So I don't know of any more perfect way to control a game like this than pointing a thing at the screen. So in, I'll put that away now and let me unplug this. In absence of a way to use something like a Wii controller which if you're familiar with that the Wii controller is pretty great because it has both the sort of triangulation of two infrared markers that the camera there's a camera built into the front of the Wiimote. It just can tell by the spacing between them if it's getting closer or further away or any role that you're doing it can tell that just by doing the math just. I mean it's amazing it works the way it does. And there was an attachment I'm miming this but I have one right here. Let's see if I've got the motion plus adapters. So where are you? There you are. So this is the Wiimote has a little camera there and then there was a bar that was just a pair of LEDs and in fact some people figured out you could even use a couple of candles and that would work. So camera was watching Bluetooth to send the data to the game console. At one point they put out this thing which is I think a gyro and an accelerometer. I don't think it's a magnetometer but it's at least a gyro and an accelerometer that you can plug. So I think I've got it in locked mode. There we go unlock it. You can plug that in there and that adds the extra precision based on having the accelerometer and the gyroscope added onto there. And in fact they're talking over I square C so you can probably use these things with our We Check adapter. I don't think I've ever tried that or if the drivers exist for it, the libraries exist. But anyway, this would be the ultimate controller. So I don't know if there's a way to play this on we or not, probably not. But absent of that, I think the nine-dough controller is gonna be a pretty good way to do this. I'll show you, let me jump back over to the Adafruit site. This BNO055, we have a couple of them. It's actually gotten cheaper and better so if you wanna buy the old one and spend five bucks more, you sure can. But that was the version that did not have the STEMIQ-T ports on it. So this one right here is the one I'm using and this is a, so you can see it's not cheap. I mean, we can get accelerometers for a few bucks but this one is quite an impressive chip and the fact that it can do heading like this, that's the key for a project like this. Most of the demos, if you look at the learn guide, we've got, oh, that's not the learn guide, sorry. We've got, there we go, these being used to control 3D models on screen. So that's a hint that this is something that these nine-dough controllers can do and if you see the model just like spinning this way at all and it's sort of coordinated turns it's doing a bunch of stuff. But the fact that that kind of heading can be read from this thing is the key. By the way, when I say that the thing takes care of the hard port parts for you, let me show you what the code I've got so far is doing and I may be doing a lot of this in terrible ways. I have no doubt that this will, there'll be room for improvement as I work on this but let me plug this in and show you what I've got running right now. Oh, let me answer some questions too before I miss them. So, Jeff Gortowski asked, not PLA, right? I did print it in PLA, that works fine for this. This is not a part that's getting hot or anything like that. Maybe that funnel would, because the port of filter basket is pretty dang hot so that could be a bad thing to print in PLA but I printed the handle of this thing in PLA. Let's see, what's the point of the game? How's it scored? The point of it is it's a partly just a idle satisfying time waster. It's almost like a OCD thing, like I gotta get everything clean. So it's very low stakes. You clean things and make money and with that money you buy better gear and go clean bigger things. That's I think the primary gaming loop of that. Let's see. Other questions, interesting that the, TenPengu says, interesting the sensor works so close to the bottom edge of the laptop. My phone's compass gets completely disoriented there. Oh, that's interesting. Yes, I am impressed that it's working that well, especially because I'm not really calibrating it properly yet. So let me plug this in and I'll show you hopefully without it taking over my mouse too badly. I can, what can I do? I can unplug the sensor so it won't run, but I can open the code. So it's gonna yell at me that it can't find the I square C device that's plugged into there. So let's go back over here. There we go, it's updated. So that's the code I'm running. This is just all I've done really is taken one of the sample example code that Lamore put together and grafted into it some USB HID mouse code that I had in some guide of mine from a long time ago. So key things, we're importing this BNO055 library. I'm also importing USB HID and HID mouse using SEMA I square C port for I square C, instantiating the sensor. I set this update frequency and that was based on a guide and I'm not sure I haven't experimented with other frequencies on the update to see if something works better or worse. I've got a little bit of code for remapping some values to other values. This is some code for doing temperature which I don't actually need, I can get rid of that. And then here's the main, you can see boy is this easy, here's the main loop. While true heading, roll and pitch, these are three variables that I've picked the names for are based on asking sensor for an Euler value. So Euler value is essentially this yaw pitch roll if you think in terms of like an airplane or something like that. And Euler's are great until they're not. Euler's are great for values that you can really understand what you're doing because it's kind of the possible orientations of a paper airplane or any object. Problem is, and that's one of the problems with when I first plug this in, Euler's like to experience a thing called gimble lock and gimble flipping. And that's because there's a rotation order that it's checking and in some places it can be just between zero and 360 and so you're getting values jumping all over the place. It's kind of default value of zero. If you turn a little left, it'll go to one. If you go to little right, it jumps to 360 or 359. So that's bad. You can also experience this gimble lock thing where if you orient it in a certain direction it will just no longer think it's moving in that direction. So you can get quaternions, which is a different way of expressing a point on a globe essentially, which is kind of the same as the pitch and roll, but it's harder to work with, harder to get your head around, but it doesn't experience these problems of gimble lock like an Euler angle does for this. However, in this case, since we're not in a VR helmet turning around and doing this kind of stuff, we're actually constrained in this like 60 degrees, 60 degrees, 40 degrees, 40 degrees, some kind of small little bubble of the full globe. So Euler's will work great. So I can ask for an Euler and it gives me heading, which way are we pointing on X basically, and pitch and roll. Then I'm remapping those. So heading is being mapped when heading goes from 160 to 200. The reason is when I initially calibrate this in this sort of default orientation, I have that zero, three, 60 problem. So I'm immediately turning the whole thing around. So now I'm 180 and I can go down to 120 and up to 200, 160 and up to 200 to get this nice little range. Up and down is actually going from negative 40 to positive 40 and those are working pretty well. And then I'm mapping those to mouse movement. Normally the way the mouse, HID mouse works, or always the way mouse controls work is you don't really tell it a position on screen because you don't always know how big the screen is gonna be, how many screens you're gonna have. So it's not a absolute position on a screen. It's actually a relative movement from wherever you happen to be, which is perfect because we still got a mouse connected and a trackpad. So what we're just sending it is remapping positive or negative relative additional or subtraction of the mouse. So move it one pixel, one pixel, one pixel, or if we're further 20 pixels. So we get sort of a faster move if we make a bigger move with the rotation. And then those remapped values are being sent, mouse.move, x equals, and we're saying, zero or one or 10 or 30, so it'll seem like a faster move. And then I am printing, that's probably slowing things down just cause I was testing stuff, I'm printing that oil or angle. And I'm also sleeping a tiny bit here so I can tune this I think and get it smoother. The, oh, Dave Glaude says, absolute HID mouse is a thing. Okay, I didn't know that. I don't know if we have absolute HID in Circuit Python. Let me know if we do. That would be good to know cause I'm playing on a very specific screen. Maybe that would be worth trying to. PenPengu says 10 hertz update frequency seems kind of low for a mouse input. Okay, yeah, thank you, I'll play around with stuff. If I'm being perfectly honest, it was not until this morning that I started trying with this sensor. I was using the just regular accelerometer and gyro from the, or just accelerometer. Do we have a gyro on that one? I can't remember from the clue. And then I said, okay, this isn't gonna work and I switch over. So I've not really tested many things on it yet. You can also see here, by the way, this from this sample example file a little more wrote, it's also originally was printing out sensor.temperature, sensor.acceleration, the accelerometer values, sensor.magnetic from the magnetometer, sensor.gyro. You can see here, if I want sensor.quaternion, we'll get four values. Sensor linear acceleration and sensor gravity. But so far, with my limited understanding of this, just grabbing oiler is probably all I'm gonna need to be able to point a spray gun around. So I'm excited that that works that well. I've never used that for a project like this. I think I've done just sort of the bunny rotating demos before. In fact, it's funny, because I forget which of these products I've used or demoed before sometimes, because we have so many, but when we look at the product page, apparently I did back in September, almost to the week, September 29th of the year 2020, I did a product pick of the week with this thing, and apparently I enjoyed sticking it in my mouth. So how about that? I should watch that video and see what I did with it. So that is my project I'm working on there with the power wash simulator, which I'm highly addicted to. I just finished cleaning up a huge playground and then a gross, really overgrown cottage. A lot of fun. And I imagine there's a lot of other games where you can do this. There's a lot of games where you're aiming. I don't know if you'll convince anyone who's playing first person shooters that this is the way to go, but it's kind of a different thing and kind of fun to think about having a spray gun, maybe with the trigger working as the power on off. You can also lock the water just in an on position so you don't have to hold a finger down. There's nozzle rotation, switching out nozzles, refilling your soap, whole bunch of stuff you can do there. Oh great, yes, David Glaude, thank you. Over in the Discord, if you wonder what I'm looking at over here when I keep talking to people, it's the YouTube chat and the Discord chat. David says, absolute mouse is in Circuit Python in this Naradoc Circuit Python absolute mouse library. So I will definitely check that out. Thank you for that. Okay, I think that's gonna do it. That's what I've got. That's what I'm working on. I'm also still working on some of the Pokemon stuff. So I'll be getting some of these projects up and running in the next couple of weeks and showing you and then writing up some learning guides. So thanks for your input. Thank you, David, for the mouse stuff. If anyone has experience with this nine-dof sensor who wants to send me info. Yeah, good point. Penpengu says the FPS gamers would probably complain about the 10 to 40 Hertz refresh. But it could be interesting for CAD. Yeah, you can make a space ball with this. If you wanna work with those kind of controllers. Oh good, and there's an absolute mouse example that David posted too. All right, well, thanks everyone for stopping by. Also, someone asked about this shirt. It is a XLR connector. This is actually from Cedar Grove. Cedar Grove Studios, that is his famous white dot of paint he puts on all his audio gear. So he knows how to reclaim it after a gig. So this is like a balanced microphone cable type of connector with the famous white dot. In fact, I probably have one right here. Look, this is the mic cable with the famous white dot. This is the opposite end of that. So that's what plugs into this thing, not to scale. All right, thanks everyone for stopping by. Don't forget to stop by tomorrow for a deep dive with Scott. I believe Fome Guy is doing some work on Saturday on his channel. So check the blogs for that and check the Discord. People will be in the live broadcast chat channel for those shows. And then we'll be back on Tuesday with my product pick of the week. Wednesday we'll have 3D Hangouts, show and tell, Ask an Engineer. So please come and hang out. It's great to be with you. Thank you for coming by. Thanks for keeping me honest when I forget to turn on mics or other tragic things like that. Freighterford Industries, I'm John Park. This has been John Park's Workshop and I'll see you next time. Bye bye.