 This is John Park's workshop. It's going to be a noisy one here today. There's construction, including an air compressor pump that's currently running out there that you may or may not hear, but I hear. So if I'm talking louder over it, that's why. I don't know how much this lav picks up, except I can see kind of a floor of noise there when I'm not talking. So please bear with me. Also, there may be a chance that I will not be doing the show next week because of continued construction, including this roof getting ripped off and replaced. It's about time. For that, it's been quite a few years. And we don't want leaks. And I want some additional insulation and reflective modern materials. So possibly I won't be doing next week. Hey, the compressor just shut off. So yay. Yeah, DJ Devon 3 over in our Discord chat said it's not loud enough to be a bother. That's nice to hear. Hello, thin man. Hello, Mike P. Hey, Andy Callaway. Jeff, DJ Devon 3. Mike P. Have I said those names all over and over again? Yes, I have. Thanks for stopping by. Hey, Sea Grover. I'm not only watching the chat over in our Discord server, but also on our YouTube. So if you're over there. Hello, thanks for watching. If you're somewhere else and you're wondering where the chat is, you can head over to our Discord server and look for that live broadcast chat channel right there. Our Discord server is at adafru.it-slash-discord. And you can jump on in there and hang out. There's plenty of other channels, too, on our server. If you've got some specific questions, interests, things you want to help out with, look at those. Look at a bunch of those other channels there. Let's see, so what else have we got going on for the show today? I've got a coupon code to give you, a 10% off discount you'll be able to use in the Adafruit store if you want to buy some things. We'll also be doing a recap of my Tuesday show, the JP's product pick of the week. I've got a fresh, spanking new Circuit Python parsec to share with you. What else? I have some updates on the glove. The Brick Tune synthesizer is now in convenient wearable, self-contained glove format. And I'm excited to show that to you. It's moved from the prototype phase into a more wearable, usable device. So I'm excited to show you that as well as some of the updates to the code that have been going on in the behind the scenes here. What else? I think I wanted to show you a cool little recycling project that I've maybe taken on based on something I found while I was walking my dog. So you know how I like to pick up weird things in alleys? So I've got a new one to show you there, a couple of them actually. And I think that's going to be the show. So let's get on with it. First of all, let's see. Hey, look right there. That's your discount code. If you want to go and buy some stuff in the Adafruit store, just type in that coupon code right there, Brick Glove, Brick Dash Glove in the coupon code feel. Here is Adafruit.com. You probably know where that is. Go to Adafruit, main page. Adafruit.com is the store front. You can check out things like products, little product drop down here, the gift ideas, the what's new. If you click on the what's new, the latest things, including some of these cool funky displays that we have coming that work with some of the driver boards, the RGB666 driver boards that I think just went out of stock last night. But that right there, this QALIA display, we're working on getting more of these in the store, this ESP32S3 QALIA display driver board you can use on some of these cool displays. But if you want to get yourself a discount on the way out, just remember to use that right there. I just lost it. There it is, Brick Dash Glove. Type that in. You'll get yourself a coupon code for 10% off. Also, if you want free stuff and who doesn't, when you are shopping, when you're here in the store, just check out Adafruit.com slash free. And if you check this out, you're going to see the different freebies that you can get at different purchase levels. So if you spend $99 or more, you're going to get the cool coaster, this thing right here, the Adafruit coaster with the gold Adafruit logo on it. It's an aluminum coaster, PCB, with the solder mask, the matte black solder mask, and the gold coat. For $149 or more, you can pick up a KB2040 right there for free and the coaster. So you'll stack these. If you spend $199 or more, you're going to get UPS Brown shipping for free in the continental United States. So maybe you're not in a hurry, and maybe you live within trucking distance. No need for ships or planes. Assume that's still what that means. Then you can get that for free with $199 or more purchase. You'll also get the KB2040 and the coaster. And then if you spend $299 or more, if you've got big, big plans, you're going to get a free circuit playground express that right there. Excellent board, fantastic for learning, fantastic for taking your software skills and turning them into hardware skills because it's got a billion sensors and inputs and outputs all built into it. Works with Circuit Python, works with Arduino. So $299 or more, you'll get the free circuit playground express. You'll get the $199 shipping, free shipping. You'll get the KB2040, and you'll get the PCB coaster, all those stack up. So head to the store, check those things out, and don't forget to type in that coupon code before midnight tonight, East Coast time in the United States. That's one that poofs out of existence. So what else have we got? So hey, I've got this show on Tuesday. Some of you have probably seen it. It is my product pick show. I like to grab something from the store and show it to you and give you a big, deep, deep discount on it. This week it was the Hallowing M4. Do we still have it sitting here? This right here, there it is. Hallowing M4. Did a little talk about it. Showed you some code, little config files you can use on our eyeball demo. And here's a little one minute recap of that. Check it out. It is the Hallowing M4 with this beautiful screen as a display for your Halloween projects, for your spooky projects, for your skull-based projects. I have a config file. It's called config.i. I'm going to go ahead and turn the iLids back on. So upper iLid and lower iLid. I'm going to uncomment those lines. I'm going to save this file right onto the drive. And then I'm going to press the little reset button that's back here. And you'll see it boots up really quickly. And now we have the lids. Just the pupil color. I'm going to make a red, terrifying red pupil. And I'm going to change the slit pupil radius. We get done, done, done. Really cool. Let's do the sclera with the reflection maps. Dome environmental photo that looks like a chrome ball type of thing. It is the Hallowing M4. Yes, it is indeed. So I think we had about 100 of those in stock. Do we still have those in stock? Let's see. Let's jump over there and see if you can still get those. The coupon code is, or rather, the discount of price is only during that show. There's actually no need for a coupon code during the show. That's out of stock. Those are all out of stock. I don't know if we're going to get any more. So that may have been our last hurrah for those very Halloweeny things. Unfortunately, those are at SamD51 chip-based, which had been impossible to get forever. We finally got them. But we have, I think, the biggest item that people wanted most was Feather M4. So we threw a lot of chips at that problem there. I think there were only about 100 of the Hallowing M4s around. And they got bought up. So show us your projects, though. I'd love to see what people are doing with those. It's a fun one for all kinds of projects, but particularly Halloween-based ones. All right. So hey, next up, let me get set up here for a Circuit Python Parsec. And here we go. Yes, Circuit Python. Hey, all right. For the Circuit Python Parsec today, I wanted to show you how you can use debouncer as a timer with a button inside of Circuit Python. What you'll see here on my desk is I've got a Feather M4. And I have one of these little convenient PCB-mounted buttons plugged into it. But any kind of button or switch would work for what we're going to do. And I just have the yellow one here plugged into that. And what you're going to see is if you look over in my code window at the bottom there, I have the REPL that's giving me feedback on things that are happening here. I'm going to press the button, and it says Timer Started. So what happens is as soon as I press that button, it starts an internal timer. It makes a little note. Hey, we've started a timer. And the next event, which is going to be me releasing this button, it'll tell me how much time elapsed. So in this case, it was 13.982 seconds. So you can see here, if I hold it for about a second, let go almost exactly a second. If I try to be fast about it, I get 0.059 seconds. So a really nice, easy way to set up a timer here that's really simple. I'll show you the code for that in a second. And you can imagine you can use this for things like figuring out not only just timing an event like a stopwatch, but also for checking for long presses or short presses. This is one way you could do that. There's also some convenience functions inside of the debouncer that do that for you. But this is the sort of fundamental timing that you can do. And the way this works, if you look at my code here, I'm importing the board library, digital.io, and the Adafruit debouncer. Then I'm setting up my button as a digital in on pin A1. I'm setting it with a pull up resistor. And then the button variable equals debouncer, and then that button pin. Then during the main loop, we do a debouncer update. In this case, it says button.update. Just looks for something to change, an edge case of something pressing or releasing. If the button falls, then we say, hey, the timer started. If the button releases, we print time, and then we print this line time button.lastDuration. So the last duration is that timer that says, as soon as something happens, we're going to start counting, and as soon as the next thing happens, we're going to let you know how long that duration was between the events. And so that is how you can set up a timer in Circuit Python using the debouncer library. And that is your Circuit Python parsec. Yes, Circuit Python. Hey, I almost tricked myself and didn't turn on my mic, but I caught it. Caught it the last second. All right. So next up, I wanted to talk about the progress on the Bricktoons synthesizer, which is now built into a glove. So I'm going to head on over to the workbench for this. Give me a second to set up over there and show this off. You may have seen this on Show and Tell last night. I'm going to go into a little more detail. Now we'll also look at some of the code, but also the build. So if you're not familiar with the project, first of all, the idea behind this is that I have a set of LEGO plates in this case, these 2 by 6 plates that I've set up that give me a nice surface area by laying four of them of each color out. And what I've done is I've selected 12 colors that are really nice and distinct from each other in the eyes of this little color sensor that I have here. So this is a breakout board color sensor for the AS3741. And this uses I2C to communicate with, in this case, I have a feather. This is the PropMaker Feather RP2040, which happens to have an I2S amplifier built into it, which makes it really convenient for this project because there's essentially no soldering required. I've got my color sensor plugged in. It has a little built-in LED over the Stem-AQT wire, which is running through the glove out over to the feather. Feather is plugged in to a LiPo battery. It has built-in charging on it. And then I have a speaker plugged into these screw terminals that are on the end of the PropMaker to connect to the I2S amplifier. So the color sensor can distinguish among these colors and trigger an event. What I have it doing is actually triggering a synthesizer, Synth-IO chime sound based on a physical modeling or a harmonics, a chime, or tubular bell type of library that C. Grover has written, which will be, I believe, is going to be in review soon for adding to the community bundle. So it'd be really easy for people to use. And what I've done is I've integrated it into this glove so that all we need to do is essentially point at or tap our finger on one of these colors, and we're going to hear a chime sound. Now, since it's kind of loud in here, let me know. Actually, I'm going to open up my Discord chat on the phone here just so I can see if people are able to hear the chime sounds, because I don't have this mic separately. I just have the speaker that's built onto the glove there. Oh, good. The compressor just stopped. That's good. And glove starts the compressor. OK, here we go. I'm going to put my mic close to it, so I'm going to lean over here. So you can hear what I have it doing is playing a little five note run, sort of an arpeggio, that is increasing its root note for each of the starting with the dark blue and ending on this yellow. The colors are actually not in any particular order other than alphabetical Lego name color, Lego color name. So this one's blue. I think this one's called light green. And this is light bright yellow or light bright orange. This is bright pink, or maybe that's not the name. This one's coral, medium purple, I think. This is dark turquoise. I forget this guy. He's a lavender, lime green, red, sand green, and traditional yellow, which it doesn't want to pick up right now. Hey, why are you not? Hey, I wonder. Oh, I think maybe I'm interfering a little bit with the spotlight. It's actually kind of amazing it's working as well as it is. Let me shield it from my, it works a little better. So I have a key light over there that's a little, a little bright. It's probably also color temperature is messing maybe even more than brightness is the color temperature messing with things. So you would ideally tune this for the environment you're playing in or set this up with a little bit of shielding. So you can imagine if I put some little Lego brick walls or put a little, I was thinking about using some heat shrink tubing on this just to give it a little sort of stethoscope like chamber of darkness, which would help. But impressively, this works in a different environment than where I originally calibrated it pretty well. Sound is a little low, DJ Devon 3 says. Yeah, you know what I'm going to do? Just for a second, just for the fun of it, I'm going to take my lav mic. Sorry for the noise. I'm going to hold that to the speaker. Try to shield from that light too. So you get an idea of that. One thing I probably could do, let me put this mic back here, I'm just going to put it on the outside of my shirt. Should stick. One thing I maybe do is add a little feedback. Neopixel color feedback would be fun to light up kind of the same color on this on-board Neopixel on here, which would just be an added little bonus and let you know when it sees the color. And right now, it's actually working quite well to distinguish these from each other. The only one that I heard get a little confused, and this happens sometimes, is if I'm a little far away from this lavender one, it will register a false positive for this darker purple. So if you listen to the dark purple one, a little far away. So it actually registers as very similar. If I come at it from the side, it should be higher. That was a higher pitch. So that is now the only one that's doing that for me, which is kind of cool. And something also that I found really impressive is how well it does at distinguishing some colors that, to my eye, are actually quite similar. For example, this lavender and this pink, or here we have essentially three different kinds of green. And this green has quite a bit of yellow in it, but it's very distinct from these orange and yellow. You can see here I have some regular bricks that match almost all. I didn't have all of them, but almost all these colors. You can see that I'm able to recognize those, even though they're smaller samples. And you may remember when I originally started the project, I was working with little 2 by 2, so even smaller, but basically half the size of that. Now something else that's interesting, I worked pretty hard to find the optimal for me semi-scientifically, semi-not so scientifically and more experientially the best 12 colors that would work for this without false positives. And that was starting from, I think, about 60 colors or so. If I reveal some of these here, these are not colors that are being used. And we'll see if any of them do get picked up. I'm pretty sure some of these will be close enough to the tolerance to pick up. So here's a couple blues up here. Let's see if any of them pick up. Nope. So far so good. Let's make sure everything's still working. Here's the red one. OK, so this purple, really similar to that one. That one picked up or violet. This dark green just got picked up, I think, as it's got picked up the same as the sand green. White shouldn't. Oh, what? I don't know what are you picking up as. Oh, interesting. That white is picking up the same as this purple, which again could be because I have some cool light color coming from there. Not quite sure. But anyway, the nice thing is that I was able to strike a balance of the number of samples that we're taking. So you can get more accuracy by taking more samples in the sensor. But then it's going to be slower to register. So you can see I've got pretty responsive. Obviously, it's nowhere near as responsive as something, some instrument like a keyboard that you would play really quickly. But it's got more of this sort of mystical quality to it in the way I've designed it. And by choosing these sounds to be a little forgiving of the speed that the sensor is taking to register these. Probably this could be tuned and improved even further. C Grover, who created a bunch of the comparison code for this, does still have some ideas about integrating some other clear channel on this, which is the white, light, or brightness level. But works well for what we're doing here. So what I wanted to do is show you some of the code here. I've shown you some of this before, but some things have changed. And also talk a little bit about the glove itself. So let me start there since we're right here. I'll take this off. So this is a hardware store work glove. I picked it because it has these rubber pads on it, these little sort of knuckle and kind of a back of a knuckle protector thing. I don't know who's smashing themselves on the back of the hand with their glove, but maybe that's helpful. So what I reason I wanted that is I could poke some holes from the inside and run nylon M2.5 screws up to mount things. So rather than mounting with tape, I wanted to mount these with some screws, which means I can unscrew these. I have standoffs there and nuts. So I can unscrew these, take them off, put different hardware on there if I want. Even the speaker, same sort of thing. In fact, let me zoom up quite a bit closer there. So you can see I've got hardware there. A little hard to see it. There's a standoff. There's another one there. And to keep it from sort of restricting your wrist motion, I only mounted the speaker in one spot. I didn't bother also adding screws down here through the fabric. I thought that was good. It's also pretty nice and lightweight. You can see I've just simply tucked the battery underneath and I wrapped a little bit of like an elastic hair band around it to get a nice snug fit in there without having to create special hardware for it. So that's, I think, a 420 milliamp hour battery there. And that just charges by plugging in. Right now, I don't even have a reset or rather an enable switch or a power switch on it. I'm just keeping it plugged into USB most of the time. That could be an addition. If you didn't mind soldering a little extra wire and switch on there, you could add an on-off to it. It should be nice. But for now, the way I'm using it, I just keep it plugged in. And then what I did for the sensor connection here is you can see there was this little palm pad here. And I just used a seam ripper to pull out about five stitches here and another few down here and ran one of these nice, I don't know if these are the 400 millimeter long stem of QT cables, but they have almost like a telephone line, like a POTS line type of modular phone line covering on them, which makes them stiff enough to snake up through here. Actually, I started from the finger and snaked my way down there, pulled it through. So that keeps it nice and neat. And then the sensor, I'm going to block the light there a little bit, the sensor, stem of QT board here, I stitched with just some black thread in four spots on the mounting holes. Not conductive thread, I'm not doing any of that kind of stuff. It's just some polyester thread, I think it was, to keep that in place. Now, you could potentially, I think we can do, from not mistaken, there may be two addresses you can use this one on. If you can, that might be a way to do two different color sensors on a glove, so you could play little pairs of notes, which could be kind of neat. Or you could, and I mentioned this on show and tell last night, you could build a whole second glove, because when you buy one of these gloves, you've bought two of them, right? You buy a pair of the gloves at the hardware store for about 20 bucks. If you wanted to, you could have one on each hand, it's fully self-contained. This is based on an idea that Jay Silver, or a project that Jay Silver built back at the MIT Media Lab that Lamor was telling us about. I haven't seen it, so I'm not sure quite exactly how it worked, but she mentioned, she thought it was a MIDI controller, which is super cool. This one just differs primarily in being a self-contained synth, using SynthIO running on here, so we're not adding a second instrument or software synthesizer and MIDI, which could go over USB in this case, or could be even a Bluetooth BLE MIDI if you wanted to in a project. That would certainly be a possibility. I did that with the Nintendo PowerGlove project. If you look on Learn, you'll see a project about that. But this one is kind of neat, because it's just a self-contained synthesizer with its own little speaker. So it is what it is, and there it is in action. So another idea I had for this is that you could create some music for it, so if you played a series of bricks that were arranged in a melody, maybe it's not playing these little chime arpeggios, but instead single notes, you could basically use it like a sequencer or like a piano roll. You could set up your bricks in a row and move your hand, or if you wanted to really decouple this from the glove, this could be a fun Lego synthesizer, mechanical conveyor belt type of project if you build like a Technic Lego belt with links and a movable, flexible conveyor belt. You could put bricks on it, mount your color sensor in a spot where it's gonna be nice and protected from outside light and have it read. You can probably get that to be really nice and consistent and play little piano rolls, little Lego piano rolls. So I'm not gonna do that, but maybe you are. And the reason that I'm excited about this project is I think it really helps, oh, I wonder what it just read. I think it really helps to make this particular sensor really nice and usable by having this sample code that does this very specific kind of thing, which is sort of the thing we wanna do with it, which is tell a bunch of different colors from each other, not just red, green, blue, but you can see we've got a dozen colors here. And depending on your needs, you could move it up more than that. I think at one point I had over 20, maybe close to 30 individual bricks that it was sensing properly. It just took longer, so it wasn't as playable as an instrument. So that is the glove. Now let's go plug it in and I'll show you what the code is doing, how this is working now. Let me just reattach this mic here. Hopefully it doesn't fall. And let's jump to this view here out of the way and unplug that. Goodbye feather. And I think I'll bring back this. And by the way, if people are interested, I could in the guide publish this exact model that I'm using since I built it already in Bricklink Studio, if you felt like ordering those parts. A lot of them came actually from the Pickabrick wall or whatever they call it now at the Lego store. Some others I ordered online from Bricklink, but if you want, you can publish instructions out of Bricklink Studio or just the model file if you wanna look at it. So what I'm gonna do is set that there. I can brighten that up a little bit or a lot. And you can see here is the little plug or USB-C plug on the side of the feather. So it just plugs in like that. And now it's charging and we can code it. And it's, oh, that's the startup. If you heard that, that's the startup sound of it doing the whole scale that I have built into there. So let's look at that. Let's look at that scale and some other stuff. I'm gonna go here. Yeah, you can see that. And I'm just gonna reconnect to that board. Should restart again or no, it doesn't need to, okay. In fact, let's talk about that. What's going on in my serial output there in the REPL if you look. Oh, sorry, one second. I just wanna look. I didn't have the YouTube chat visible and I wanted to say hello to Randall Bone and Dave Odessa and Gavin Bell. Hello, thanks for stopping by. This was a question Randall had that I missed from earlier when I was showing the feather debouncer. So this debouncer will, I had it printing or rather the code was rose and fell. So rising and falling means it's going from a high to a low or a low to a high voltage on the pin that it's measuring. So this sort of acts like a voltage divider and it'll pull the pin high or low when we press that. So rising and falling is rather than just a state of true or false. It says we're going from one to another. We're going from low to high or high to low. And that's the terminology of the debouncer. If you look up the Adafruit Debouncer Library in circuit Python, that's the terminology that's used. And you can in fact go to our, let me show this real quick, to be thorough about answering this question. If you go here to Adafruit and click on the learn link, type in debouncer and you'll see there is this Python Debouncer Library for Buttons and Sensors. This was Dave Estels who wrote the library, has a really thorough and excellent explanation of how it works and it should make some of that make a little more sense if you're curious about it. And so thank you for the question there, Randall. All right, Zeezy Gavin says, publishing the Lego plans would be great. Thanks, yeah, happy to. Oh, Yanisku7 says, how does the Lego Mindstorm Color Sensor work? I don't think I have one of those. I had an older, let's look. Hold on, let me show this webpage. So this is a link to the EV3. I had the older Mindstorm set, which I don't know if it had a color sensor or not. It may not have. So this is a link about the EV3 Lego Color Sensor. Yeah, I'd be curious. I bet if you Google around, it'll tell you what chip they're using. Looks like they can detect black, blue, green, yellow, red, white, brown. That's at least what they've set up here. Really cool, neat. I've never seen that. All right, so back to the one that I do have here and running, the, if you look in my little serial output at the bottom there, says when I, I'm gonna go over new color, I'm gonna go over the blue. So you can see it went from saying no brick to sensor color. And this is giving me eight wavelength readings. So this sensor reads eight different wavelengths. It's the AS7341 for color. And then it reads a infrared and a clear, they call it. So we're just reading these color ones and they're each like the 415 nanometer and the 495 nanometer. And so it's these little chunks of wavelengths that it's able to sense. And what I'm getting on that blue brick when I look at that is this here, about 76 on the lowest end of it, which is the violet roughly, like to put into color terms. Violet, indigo, blue, cyan, green, yellow, orange, red. That's what these eight wavelength subsets are. So when I read, when I read this right now, I got, let's just look at that violet channel, 76. In my code here, I have it printing out what is the reference sort of my calibrated original sort of hand calibrated number for violet. It was 94. Okay, that's pretty close. If you look when I tap on green, it has 119 in the violet. So that's roughly the same distance away from violet as the blue was. But it's the aggregate of all of these, if that's the right word of it for it, of saying, okay, we were 76 on violet, but we were 966 on indigo, and the green brick is nowhere near that on indigo, right? So we're doing this big comparison of this set of values. And so when it tells me, hey, I see 76 on that blue brick for violet, and the reference was 96. Well, what we have is a tolerance value we can set to say, how close to this sort of aggregate of values do we need to be to have a perfect match, or not a perfect match, but an imperfect match that we're gonna allow, right? What's the sensitivity level or the tolerance level? So the value I have here, if you look at the top of my code, tolerance equals 800. So this is, again, something you could tune. You could even make maybe a dial or something like that on your device to tune that. And the color matching tolerance index is zero to eight multiplied by the maximum sensor count. And the maximum sensor count in this case is about, I think, 6,000 something. I forget what it is. I think we can go up into the tens of thousands on tolerance, depending on what you're trying to do. The sensor, also, I mentioned, has this how much time you wanna take to be how accurate. It's this little balancing act you can do. So we have the steps and the time, the integration time for the step count. And so I'm using 128 steps. So we could go quite a bit faster if we dropped that, but we would maybe miss values outside of the tolerance range. So this is the little sort of balancing act you do between a number of steps, the amount of time that you spend reading a step. Then this also has gain. There's sensor gain and the LED current, which I think Cirova was saying he wasn't noticing a difference on. I thought I had, but I can't remember now. Let's see, I'm gonna set this to one and watch this LED if it gets dimmer. Not at all dimmer. Okay, I imagined that back when I thought it did. So that apparently doesn't matter. That might just be an error in the library that could be corrected. So the, yeah, print max sensor count. I have that, let's reload the code here. Maximum sensor count, hey. Oh, I'm scrolled way down. Why are you not printing? All right, let's give it a little delay here. I'm actually becoming a fan of my code playing a little tune for me when it restarts. Hey, this is weird. I don't know why it won't print that. What, let's print it a little lower in the code about. Cause I see it printing my welcome to brick tunes ready. All right, let's print it right there. Wow, it refuses. Why do you refuse? Do you really need more time? It is very strange to me. I don't know why it won't show up. This is the code I'm running, right? Huh, or is it? This one doesn't show my, yeah, this is what's running on there. All right, let's print it after we say brick tunes ready. This is really mysterious. Why wasn't it printing that? That's bizarre. Okay, yeah, the max sensor count here is five, nine, five, six, five, seven, nine. Oddly, it's not now, it's now not printing the brick tunes ready. Okay, something goofy is going on there. Close the file and open it fresh. Okay, let's do that. Good idea, Todd, thank you. Yeah, okay, well, it's busy thinking about stuff down there and it does not like doing both of those things right one after another. I've got one more, sorry, this is not that important but I'm gonna fight it. I don't want to print here, I want to sleep. Oh, and also press reset on the board, Todd suggests. This is another good idea. I will, it refuses. I am weirded out by that. I'll have to deal with that later. Okay, so let's look at some other stuff going on the code here. There's a lot happening. So this is the magic color comparison code that C Grover wrote. It's compare n channels colors. So it compares two integer multi-channel count tuples and so that's like the eight channels of what I'm reading versus the eight channels of the sort of look up chart, look up table that I've made. You can see that below here. So there's my kind of averaged, held it in some slightly different lighting conditions, held it for a while and looked at the number settle and said, okay, yeah, that's a pretty good value. Yeah, Andy Calloway says Python sometimes does weird things like that, it sure does. Todd says it's because you're printing out stuff before it's available to your hosts USB. If you control C and control D, you might see it. All right, I'll try that. Still no, bizarre. So this, I don't pretend to understand the math of this, but this is this deltas of the color index minus count to IDX count enumerate color. Okay, I'm gonna get C Grover to write up and I'm some of the explanations in here, but I'm hopefully gonna get him to write up a little bit in the guide of how this works. This is, like I said, the list of the colors that I came up with that works well in their sort of reference values. Here's their names. I may switch this into a little dictionary with a key value pair set just to make it easier to look at, but that's what I have. Then I've got a little list here that's called brick states and this is a set of, it's a little list of whether we are looking at a brick or not. And I use this to, if we wanna use this to sort of sustain a note and then stop playing it versus play it instantly, regardless, we have a little bit of leeway there to say, okay, are we looking at a brick or are we looking at no brick? And that's when you see in my code here and it says bright green and then that means the state right now is true for that one. Then when I move off of it, it says, okay, no brick, we're not looking at a brick. And this was a cool suggestion from Todd. I originally was looping through eight times or however, 12 times, however long the list of colors is. He said, okay, you can kind of optimize this by saying your list name equals and then in the brackets, false and then multiply that by the number of entries of false you want inside that list. And I always forget how to do this, but he reminded me about it, so thank you. So this is essentially saying brick states equals the word false times 12. 12 is just the length of that list right there. So thanks for that reminder. I like that syntax there. That's pretty efficient. Then I'm doing some of the typical audio setup and I'm using the I2S amplifier that's built into the prop maker feather using the audio mixer to set the volume. I've got it set to full volume here just so you have a prayer of hearing it, but you can make it a little quieter when you're in the privacy of your own home in a quieter space. And then I'm using this chime, if you look up at the top at the libraries I'm bringing in, I'm using this Cedar Grove chime library which he designed to do wind chimes. And I think he showed that off on show and tell a few weeks ago, very cool project. I asked him if I could use it for this, for the Lego bricks. And you can see here it has these functions for the chime, the scale that you're playing, the voice, the material and the striker. And we'll look at what those are a little bit here as we scroll down. There are chime scales built into the library, but I wanted to use my own particular scale and that's because I was doing these sort of arpeggios and I wanted sort of pentatonic arpeggios here. So I have all these whole notes and I have three octaves of them listed. You could make any scale you want in here. You could make a spooky sort of minor key thing for Halloween if you wanted. And then I'm making the chime object using that scale. And then I'm also setting the materials so you can have this be different materials and it'll give you harmonics that are different based on the physics of those materials. Both the object that's getting struck and the thing that's striking it. So if I wanna make a much different sound here, I'm gonna hold the mic to the speaker or bring the speaker to the mic here when I play this one. I'm gonna make this ceramic. So you can hear that, does not have any of that big ringing type of sustained harmonic. It dampens very quickly because it's a ceramic material instead of brass or aluminum or steel. Let's do, I think there's copper. Very luxurious, the copper sound, I like that. This is my little startup thing that I'm so happy about which is just, hey, when it starts, since we're doing something with sound, kinda nice to just play the sound rather than wait for it to fully boot and have me instantiate it with a color. So this is a nice way to listen to the scale that you're gonna play there. So that's what this little loop is here. Then I battle with these print statements here which someone, I think Andy Calloway said, yeah, Python sometimes does weird things like that. Sure does. Oh, and sorry, Cgrovers said in the chat, the LED brightness is in milliamps but the resolution is in four milliamp increments. So the next brightness current value is eight, I see. So it should be four or eight. Okay, thank you. Then in my main loop here, you can see I am, I mentioned this before but I'm still doing this which is, I just, since the Indigo channel tends to be the darkest one on these based on the colors I've picked, anyway, I can tell if we're not looking at any of the bricks by just saying if it's less than 70, then there's no brick there. That's what says, okay, we're looking at darkness. And that was both something I can use, like I said, to release a note or to just not bother calculating all the color values all the time which probably speeds things up a little bit. If that does go higher than 70, then we do the full check here. So I create this variable called data which is all the channels. So we get, in this case, eight. No, we get 10 channels actually, right? Is that right? No, I think we just get the eight color channels. I think the other channels have different names. So that, yeah, that right there, sensor color grabs the first zero through seven. Okay, yeah, so sensor all channels does grab, sorry, it does grab the IR. Sorry, I haven't dealt with this in a while so I forgot. So that grabs IR and clear, but then we're just saying we're only gonna look at the first eight of those zero through seven. If we're in debug mode, I print the sensor color kind of the whole time I'm over a brick and I'll show you that right now actually. So if I go back up to the top of the code and just say true, okay, now what I'll do is I'm gonna hover over this blue channel and you can see now I'm spewing out the color values constantly. I'm wiggling it a little. I'm gonna see if I can stop touching it. Okay, so hands off of it, you can see it's pretty stable. Those numbers are changing by maybe the ones, like one value on some of them. If I come over here and reflect some light off my hand or take a flashlight, I can probably really screw it up. That doesn't appear to be any known color to it so it's kind of ignoring it, but this is also partly why I'm doing the whole keep giving me info while we're above 70 on that Indigo channel and actually I should probably lower that a little because we're really close. But now I went to no brick for a moment and then it saw the brick again and it played the sound and now we're back to no brick. So that debug mode there is kind of how I'm looking at values when I need to calibrate right now. By the way, I just have to point out, sorry, I don't have a screen to share for this, but over in the YouTube chat, there was a statement about the Nobel physics prize, they were able to get 802nd resolution using waves. Paul said 802nd intervals and someone solved the frequency to say that's a million, Mike Jones says that's a million gigahertz according to chat GPT and Ricardo Madgello Esquire says one 802nd wavelength is one quintillionth cycle per second frequency. That sounds like a lot. All right, so back to the code here. We are building that little list of the color channels and then here's where I do the color match. I say for I in the range of the eight full spectrum values, sorry, I in the range of the 12 different color sets, sorry, we look at each of those in that lookup table and then we do the compare. So the color match is compare and channel colors, whatever I just read versus my reference table, my lookup table, their brick full spectrum value. That's this list of numbers here. So we just go and do that comparison. I say just, this is fantastic and amazing that this works so well and thanks again to see Grover. The color match returns either true or false. There's also some interesting stuff you can get from it like a delta to say how far from the reference are we? And that's also helpful for tuning this to your lighting environment. If the state is false, meaning we're not already looking at a brick, then we're gonna go ahead and print the brick name, play the chimes. You can see I have a little sort of algorithm for these chime intervals that play. I have a little tenth of a second delay between chime strikes so it plays them sequentially with a little notable sort of space between them. And then we set that brick straight state to true so we know we're on it. We don't have to like keep repeating it. We don't have to keep looking for the values unless we set that debug to true and then we flip the value of the gap state and repeat. So that's what it's doing now. I'm getting close to done with this. Clean some stuff up a little bit and publish this into our GitHub so that's available for everyone and then that'll set me up to write it up in the learn guide. So thanks for letting me talk on and on about this. I'm excited about this project. It was a really fun one. Thanks, Lady Aida, for suggesting it. The last thing I wanted to do is I mentioned that I had found something cool on a dog walk next to a dumpster. So let's come over here and take a look at this. Let me just set my camera switcher, which I need to restart. And what this is, is a server power supply. I found this little Dell personal server power edge, I think it was called. I forget the model number on it, but it's essentially a desktop chassis with a server in it rather than a rack mount server, but it has redundant power supplies in it. So I got two of these. They were easy to unscrew and pull out because they're meant to be hot swappable. This is a, I believe, 580 watt supply and it does 12 volts at 48 amps. It has a, I believe, a positive and negative 12 volts on these little sort of blade looking funky, I think it's a Molex or maybe someone else, but this is a funky little connector because this just slots into the back. It's meant to, you can see, it's even got the little rail there and a latch. So you just pull that, there's two of them. So one will keep running, you pop the other one in and that's the idea to keep your server running. A little integrated fan there, some venting, some giant ass capacitors there. And I'm interested in getting these running because they're pretty cool. I think it potentially, looking at some stuff online can give me five volts positive, negative 12, positive 12 and maybe 3.3. And the way that it is controlled normally, as you can see, there's these little Dupont space, 0.1 inch space connectors right here. And those have different, this plugs into a little receptacle in the machine and then some of those are gonna be just hooked up to like your power switches or soft power switches. Some are gonna be computer controlled configurations or temperature controlled configurations. I believe there's fan speed control like two states you can do on it. And some of that just comes from jumpering these wires. So it's a little hard to find the pin out but I think I found one that's working for this. And I don't think I'll fire this up right now. I did have it up and running and giving me fan spinning and four volts on one of these. So something was wrong. And one of these was acting like ground and the other was positive, I think or maybe it was a differential and they were not what I thought they were supposed to be. So anyway, clearly I don't know much about it right now but it is fascinating. These probably go for $30 to $50 online if you try to get a replacement or a used one but kind of a nice alternative if I can get it configured and user friendly enough kind of a nice alternative to a little mean well supply for getting a LED light strip, motor, Halloween thing, Euro rack synthesizer power supplies are always on my mind. So cool little form factor for the supply and I'd be curious if anyone here has experience with these. I think they're popular among RC car enthusiasts who charge batteries off of them. I guess either they're getting these down to seven volts or they're maybe they've got 12 volt charging going on but neat, neat little supply. Got a couple more for free. Made by Delta Electronics Ford Dell and it is the DPS580AB that's a reference number. The model number is D580ES0 and I've been searching those things and related things. It might be like the T510 was the power edge server something like that. So hit me up in our Discord server if you have info or interest in that because yeah, it's a fun potential free power supply project. Who can say no to that, right? And I was walking the dog so I couldn't carry the whole thing home. So yeah, 12 volt, 48 amp, nice, nice supply. All right, I think that's gonna do it. So what's going on Skr? We have signal. All right, wait, I gotta see what did Steve say that got that response? If you elicit a, all our base are belong to you. Set him up and learn. Are you talking about C Grover? He is set up and learned. He's written us some really cool projects before and he's got, I hope you don't mind me sharing this but he's using our fairly new feature. Let's see if I can find it of these playground user pages. If you go to learn and type in C Grover, use slash C Grover. So learn.datafruit.com slash use slash C Grover. That won't get you 10% off in the store but that will get you to, let's see, is this, are these not the playground pages? I'm confused, sorry, playground. All right, let's try that. Here it is. Okay, it's so much easier than I thought. Just go to atafruit slash playground.com or on the main Atafruit page, at least on the main learn page, there's a menu up at the top. Click on playground and you'll see, here's a guide by, or a user page, a playground page by C Grover right at the top there. It's using this same light sensor. By the way, when I asked Jan about this sensor, he said, oh, I've got a project I've been working on to do a backlight behind the TV that matches sort of an average color of what's going on on the TV set. Kind of like, I think it was a Philips Hue project like that at one point and we have, I think a Phil Burgess project using Arduino that does that. So he was able to use some of that info to help me with my Lego project. If we click on that, do we get, oh yeah, okay. I think I lied, I was confused about a different thing. Jan's also helping with this BN0055 sensor calibration tutorial, so he's also got his palette faders. So anyway, these playground guides, they're new, so I'm confused about them, but they allow you to write up your own little mini learn guide pages using some of the same tools that are in Learn Guide. If you're looking for a place to document stuff, you can see it lets you do links, little code embeds, images, even product embeds if you wanna share easily which stuff you used in the project. So if people wanna just click on them and learn more or buy them, you've made that easier, so that's nice. Anyway, go check those out, and that is C Grover sharing a lot of information with us. So thank you. All right. Is that gonna do it? I think that's gonna do it for today. Thanks everyone for stopping by. Like I said, this is the coupon code that you can use if you wanna get 10% off in the store, type in brick-glove, that will get you 10% off in the store until midnight tonight. Go find some cool stuff, make yourself some Lego gloves. Why not? All right, thanks everyone for stopping by Graded Fruit Industries. I'm John Park. This has been John Park's Workshop. I will see you. I plan to see you next Tuesday with a product pick of the week so long as the roof is still here. It's a good chance I won't be doing this show next week and I'll just push it to the following week. Okay, thanks everyone. Bye-bye.