 It's me, John Park, and back there is Lars, and you today in John Park's workshop to do a little bit of a Lars seance or something like that. Oh, look, I didn't change the title of the show. That's gonna be confusing to me at least. Hold on, hang on one second. That's a little oversight there. Let's see how quickly we can fix that. Lars seance. So here we are, and we've got a whole bunch of cool, fun, stuff, interesting things lined up today. First of all, I want to say thank you to Hesitant Road, who said nice beeps and boops. Thank you very much. And thanks to all of the people who have stopped by in our chat. If you're wondering where the chat is, by the way, if you're over there in Twitch or Facebook or LinkedIn Learning or one of those places where we're streaming, but seemingly the chat is empty, that's because it is. But the chat is happening over on our Discord for the most part. You can go to Adafruit.it slash Discord, jump into the live broadcast chat channel. That's where our chat's happening. And I also keep an eye on the YouTube chat, but the sort of largest group of people you'll find at any given time chatting about Adafruit stuff tends to be on our Discord. So head on over there. What else? Oh, before I forget, we have a new coupon code for today, seance. It's a weird word, seance. I don't know what the etymology of that word is, but seance, that will get you 10% off in the store. So head on over to the Adafruit store, throw some stuff in your cart. It could be anything that's real and actual and nothing that's virtual or imaginary, such as gift certificate, software, and subscriptions. But physical bits, those kinds of things, will give you 10% off. And that is good until midnight tonight, East Coast US time. Hello, Johnny Bergdahl, stopped by over in our chat. Nice to see you. And that's all I have to say about that. So you seance when you're checking out, that'll get you 10% off. I'll remind you of that later too. What else? We've got a help wanted sign up over here at jobs.adafruit.com. So if you are looking to hire someone or if you are looking for work yourself, you should head over to jobs.adafruit.com. It's a free job board, doesn't cost anything to post your positions that you're looking to fill, doesn't cost anything to post your own resume. If you click over here on this available for hire section, you will see we've got people who are posting their skills and their resumes and so forth, looking for work of various kinds. And you can post full-time, part-time, remote, freelance, contract, any and all of the above, onsite, off-site, all of it is potentially available. So head on over there and check out some of those positions to see if anything is interesting to you. All of these are vetted through Phil and LeMore. So we're hopefully not letting any creeps and scammers through. Hopefully this is all legit people. That's our, I don't know if we have any guarantees around that, but they are vetted. This is not just a free for all. So head on over to jobs.adafruit.com and look for some work or look to hire someone. All right, so on Tuesdays, many of you may be aware, I do a show called JP's product pick of the week. That's the logo right there. And on the show, I pick something, new product or an oldie but goodie. You get a huge discount on it. It was 50% off this week. And I do some demos with it. This week actually was a rarity in that it was a, what do you call it, a reprise. I've come back to it, the sequel, part two. Now it was this NeoKey five by six, but since I had first done this as a product pick, which was more than a year and a half ago, some new ways of working with it have come on the scene, some new matrix gizmos and things. And I put together some new projects with it, which we have some learn guides up for. So go and check that out. Here's a one minute recap. Is the NeoKey five by six ortho snap apart PCB. This has socketed key switch receptacles. So you can take your key switches. You don't need to solder them in. You just place them into their little sort of spring loaded clips there. And now it's ready to go. That is collecting the column and row presses and then sending key press and key release messages to the microcontroller. And then I'm also sending it NeoPixel color changes. So when I press one of the green ones, it turns pink. When I press one of the pink ones, it turns green. So that is kind of helpful feedback that you can use, especially when you don't have printed key caps, just to keep you oriented with what you're doing. NeoKey snap apart ortho five by six PCB. Yes, indeed it is. That's what it was. So next up, let me get set up here for our circuit Python Parsec. There we go. All right. Check this out. Hey. Yes, circuit Python. All right. So for the circuit Python Parsec today, I wanted to show you how you can use NumPy to speed up LED fades. This is directly based on a really cool post and code from Todd Kurt. And you can head over to his GitHub at github.com slash Todd bot slash circuit Python underscore LED underscore effects. He's got a couple of sets of tips there. So this is really cool. What I have here, I've got a feather M4. This also definitely works on a RP2040 and probably others. And I have one of our eight by eight NeoPixel arrays here and a nice little case and diffuser separator design from the Ruiz brothers. So Todd was posting this as a fire type of effect hence these colors. What I have running right now is the straight sort of normal circuit Python code. What it's trying to do is fade these NeoPixels as fast as possible. So there's no delays. This is as quickly as it can go from the full color down to black. And then what I'm going to do is I'm going to turn on the NumPy version of this. And then we'll take a look at how much faster that gets. So check this out, look at the animation here. And now I'm going to resave this onto the board. It's going to restart here in a second. And you should see about a 10 times increase which is really tremendous. The way this works is in the code here importing from the micro lab library NumPy as NP. Then when I'm setting up arrays of LEDs we're setting up a NumPy array that's this NP array which is the LEDs and it's an int 16. And then we're setting up this array for how the amount it's going to fade by. So it's essentially clamping it. Then when it comes time to fade these down again in this if use NumPy so that I can run just this we adjust that fade amount. I'm going down by one step negative one. Then we take this NP.clip the LEDs NumPy array and then setting it between zero and 255 for each of the elements in the color list. And then finally we're taking that list and applying it back to the group of LEDs. So essentially NumPy does these calculations off on the side then gives them to the LED rather than running it in real time like we normally do. Here's our normal loop that we would go through. And so you can see here we get a 10 time speed up using NumPy. And that is one way that you can increase the speed of LED fade using NumPy inside of CircuitPython. And that is your CircuitPython Parsec. Yeah, and I'll mention over in our Discord I can bring that up here. Todd posted a link to that. He also has a blog post about it which is very informative. There's the GitHub code but also check out that code, rather that blog post explaining it. He also has some nice videos of side by sides. I didn't have time to put together a second one of these so I just went with the, go over this view of things. I just went with the adding a little switch in my code but you can see it pretty clearly here since I'm pretending it's a larger array than it is. It's calling it a 256 which is a trick Todd came up with just because you can tell the difference a little easier. This does still have a noticeable difference with the true 64 pixels in here and then changing the fade by amount. In Todd's example it was three. I'm changing it by one so I'm forcing it to step through all the entire range of fade through the colors that it can go. This is by the way a really nice effect if I boost the brightness on this, how about? It looks cool to look at. It looks really great as a sort of fire effect. So if I grab, let's see, I grab a skull here and let me go to camera front view again. I'm gonna turn off this. So if you're doing some prop stuff and you wanna do a fire effect, take the diffuser off too. You can see we get a nice, look at the bottom of this chin there. So you don't need to see the LEDs we get a really nice effect, the sort of flicker, burning, fire, lava pit, embers, hellscape sort of thing. Works a little better on the skull. So I think that's a really nice tip, really nice trick there from Todd. Thank you for sharing that. And that is the beauty of open source community and people sharing stuff is that we get to benefit from everyone's work they're doing off in their own weird little worlds and get to share it with each other. Shouldn't call it weird. So thank you for that. Let's see, what else have we got going on? Mentioned, oh, so let's head over to learn. And apologies if you're sick of the keyboard stuff, but I did publish the guide for my OrthoSplit keyboard. And if you've been here for the last few weeks, you've been following the progress on that, but I just wanted to show you the guide is up. So if you had to learn.aderfruit.com, you'll see here, I've got my, this one over here, I've got my little animated GIF there, you can see it going together. This was something I did a little later. So in some of the photos, I have the STEMIQT cables plugged in directly. And then in the second view here, I've looped it back around to the opposite side. And that is really nice because it gives us some strain relief. It also means we can feed those cables in. The photos of the build show you that. So if we head over to build, I've got a little fritzing diagram there of all of those many column and row connections to the two matrix expanders. Show you how to wire those up, how to add the second STEMIQT port to your QT pie. And remember that's because the QT pie RP2040 has two I squared C buses. So even though the TC8418 only has one address, we can use two of them without any fancy external matrix for I squared C. I got some build photos and files for the case. If you wanna do a 3D or a hybrid of 2D, 3D using some lovely little threaded inserts there to screw things down. Switch plate, attaching your keys and key caps and then mounting. And you'll see here, this is the photo here of the mounting method of going through, routing around and then back. And you can also feed it through those two standoff screws if you want to really give it a nice amount of strain relief from friction and mechanical mount. Adding little QT pie mount, which you don't need to do if you do the fully 3D printed is when I made the base mount and walls all one piece. So if you print that, the only other thing you need is a lid which can be 3D printed or 2D also. 2D, by 2D I mean laser cut, not actually two dimensional. There's the little add-on STEMI QT port. Cool little, this is from Sparkfun. They have this great little, just connects to I squared C and gives you two STEMI QT ports of the little tiny variety, quick ports as they call them. Adding your case top, connect the halves. This is only relevant if you didn't do the wrap around method for that cable. If you want to be able to separate them, then you can feed it in from the side. It's a little tricky, but you can do it. Some tweezers or needle nose pliers will help, but you could probably do it with your fingers. And there's that final version there where the cables wrap through. And that is it. And then of course goes into the code, CircuitPython, putting that on your QDPy and adding the code directly from the GitHub. And that one I broke into, and actually, sorry, I don't think I showed this. Let me show real quick. I'll just, in fact, I'll just show it inside of the guide here. I have two files that you'll download with this. One is the code.py, but you'll notice in code.py, one of the things it does is it imports the key maps. And that usually we're used to seeing that import be a library. It's actually just a separate file. It's kind of a config file where I map what each button corresponds to in HID key presses, as well as what the meaning of the different function keys and shift layers or different layers are mapped to. And you could add more and more of those if you wanted to have multiple layers that would work as well. I just have a couple of things to change in code. So from here, I import this layer key maps. If we scroll down, you'll see I have the config file. There it is. So there's the key maps file. I tried to make it clear visually. It takes up a lot of space, but it's easier this way rather than one big long list. So this is the left side at the lowest layer. So it's left zero. And this is the six keys in each row, what they correspond to. So you can see at the bottom layer, I'm not using a bunch of the keys in the middle, really just the top row in the bottom. That's the right side, which I have a few extra keys there. This is the main layer. So you'll see this is all of our numbers, escape, accent, tab, shift, control, all the letters or half the letters, I should say half the numbers. Then the right side of the keyboard is the rest. And then we have finally the top layer. So when you hit that raise button, you've remapped all the keys to equal some of these characters minus equals backslash, the different brackets and curly brackets, those are all there on the top layer. So that is all I wanna say about that. So go check that out if you wanna build one of those. I'd love to see your builds. All right, let's see. So next up, what I want to do. Okay, so last week, I'm gonna turn off this Lars. He's gonna talk to us from the great beyond in a second anyway. So last week I started down the path of this thing here. Oh God, I forgot I said it there honestly. This thing here, which is this seance board, Ouija board, I think Ouija is a trademark name, so I probably can't use that. Turn this light on over here. And so go back if you didn't see last week, you can go catch the archive, head into the about 15 minutes into the show and you'll see me run this thing, take it apart and explore the possibility of modifying it. So that's what I've done in the interim. So I wanna show you all of the modifications I've done here. Let's jump over to, oh, my camera size got super big when I wasn't watching, let me fix this and send it to you. That's a little better. So let me jump over here. I'm gonna pull up the Discord just so you can let me know. If you have any questions or thoughts, I will still keep an eye on it. What I need to do is set this phone to never fall asleep because sometimes it does. And, there we go. So here's the, I said Laura's over here. Here's the guts that I've used to take over this thing. And it's a little messy right now. I'm gonna use much, much shorter wires. These jumpers are ridiculous, but they were just the easiest way to try things out before I commit to soldering or shorter jumpers. So we'll pull all this apart and talk about what we're doing and the pieces we're using to do it. So I'm gonna pull this off and you'll see at the moment, I actually don't need any of the original guts of this thing. So in here, we have, maybe I'm gonna take over this. I may just mount all this stuff on the back in its own little box. This is the three-way switch, on-off switch. Also there's a little, let me set this over here for a second and zoom in. So this is kind of interesting. You'll find this on prop things and toys sometimes that are meant to be demo. They'll often have a little receptacle, kind of like a little two-pin JST connector in there actually, it looks like. And those will have a, sometimes just a button or sometimes a battery in a button. And so you can do a demo mode without running the full batteries down or maybe they're not giving you the double A's or triple A's. Sometimes it's just a switch or in this case, I think it's just, there was an external switch. It wasn't there when I got it, but my box was kind of torn open. But that when you see a hang tag thing that says, try me and you can click it, sometimes it just plugs into that. So that's what I'm assuming that is, I didn't actually test it, but that could be it. The other thing it could be is just external power so that you could run this maybe to a plug-in in the wall. So I didn't, I have not actually checked to see how that's connected. But it looks like, it looks like it's connected to ground and this pad marked P-A-1 off. Hmm, I don't know what, but probably that was just an external on off switch. And it just set this thing to go through its loop one time. So then the other things we have in here is the battery box and may try to reuse that because that would be good for powering the feather because it's three triple A's. So that would power the feather just fine. And then we have, I'm not using this at all. This is a little P-A's-O element that was being used for knock detection and sound detection, I think. This thing is such a big acoustic chamber that I think it can pick up sound, loudish sound as a trigger like clapping or something like that. And then this is the speaker for sound effects which I didn't like at all. In fact, I can turn them on. Okay, so what the board is trying to do right there is trying to run the motor and this only ran the motor in one direction. And it also lights up these LEDs, these white LEDs at some sort of little interval. Maybe it's a little random, I'm not sure. So what I wanted to do is take over those functions. So I've taken over those functions by cutting all that out of there. I went ahead and removed the LEDs as well. So those just kind of pulled out, they had hot glue on them but it was not hard to just yank them out. And you can see I've glued in, wow, that's bright. Let me see, can I turn this, is this light at its lowest? That light is as it's at its lowest, isn't it? Nope, that's a little better. Let me see if I can get lucky and change the shutter on this. Nope, I don't know what mode that's in. All right, let me turn off this. You know, I'll turn that light off altogether. That's better. So you can see here, I've glued in with hot glue one of our neopixel strips that has these sort of Christmas light style neopixels. Originally there were just five, I think, one, two, four, three, four. I can count right here. One, two, three, four LEDs. The spacing of this I was able to place some of them in the holes that the original LEDs were in or over kind of over the holes. The others shine through anyway, they're bright enough and this is all translucent plastic, which is great. And then those are just running to my board here. Let me show that. So those are running to power ground and pin D6 on my microcontroller on the featherboard. So right there, we now have the ability to either just set them to different colors, which I didn't really like the bluish white of there. So I've got kind of a yellow, red color and control them based on Bluetooth. So all of this is going through the feather and it's a feather NRF 52840. So it's got Bluetooth. And then from Bluetooth, I can do things like tell it to turn the lights on and off. Next thing I did was took over the motor. So you can see the motor here was running on their own motor driver. Just ran in one direction. I used the motor featherwing here, which is an H bridge that can go forward and backwards. Means I can also control the speed of it. Right now I just found a speed I liked and I measured the voltage on this. I think it was at about 4.3 volts or something like that when it was the original board. So I am giving it roughly the same. I'm running off of, I can do about six volts because I'm running off of four double A's, but I am now controlling the speed of the motor using our motor code. And then that is not only something I can just turn on and run, I can run it in reverse, I can also stop it and I can do that from the phone, which is a cool effect. It means you could kind of remotely puppeteer this prop if you wanted someone to have an experience with it. You don't need a bunch of sensors on it, you just watch them from the corner of the room or behind a curtain or whatever, like a real seance and have it run when you want. And then yesterday, in fact, yesterday evening in one of our Creative Engineering Group meetings, LaMoure said, hey, how about you also add sound to it? So the original had that one sound effect that looped. So I added that I2S amplifier that I really like. So this is I2S sound, high quality sound. And one of these little beefy four-ohm three watt speakers, you'll notice one of the hallmarks of smart speaker design for these types of things is use the surface as a resonator. So this little tiny speaker here probably sounds tinny and not like too much and not very loud on its own. It is mounted into the case here. One thing I will probably try is see if I can just run that speaker because it's probably the optimal one from my amplifier. But for now, just in testing, I wanted to use a separate speaker before I cut those leads and wire it into there. So that's the basics of the setup. What I have going on here, I'm gonna try to zoom out a little bit and clean up this thing has got an ol' cockamamie. So here is a LiPo battery that is running the feather right now. And that is connected to the feathers JST battery port via one of these little on-off switches. The feather and feather wing are mounted on a feather tripler so their pins are all as if they were stacked. That works out really well. The motor feather wing just has an output for the one motor. I'm only connecting to one motor, we could connect up to four. And then the input for power is coming from this, which I can unplug. So I just took a couple of silicone wires, connected them with crimp connectors on their ends to a barrel plug, DC barrel plug. And then on the other end, I have my battery. So again, just trying to keep it modular and disconnectable, reconnectable while I'm in this planning phase. So if I turn this one on, you'll see the power goes on the motor controller there. Let me just sharpen that up a little bit. And then finally, I had this space here that I could plug in my amp, I2S amp. So it's plugged actually into, I put some header pin there just for flexibility. And then I ran those headers to their own second set so I could just jumper everything for now so nothing is soldered. And those run to a row of feather headers here that connect to this row. And then a second row here that I sort of mounted through the holes of the feather wing. So everything's accessible basically. So for that, we need three pins. There's the clock data and the other one. I can't remember what the I2S protocol uses. And then power and ground. One thing I haven't done with the amp yet is test, and I'll probably do this when I test the speaker that's built into there, test out what is the ideal gain setting. The gain settings on this little amplifier are done by placing a resistor between various combinations of pins on the board. So again, by having a little header pin breakout or socket breakout there, I can try a resistor in different gain settings there. Right now in code what I have, and I'll show you this in a second, is I'm using the audio core and audio mixer. And then in the audio mixer, I have the gain or the volume of the voices set really low. So something like 0.08 for background music or lower and 0.07 or eight, I think for the voice sound effect that you'll hear. So let's see what I'll do. Let's do a little demonstration of this from the guts side of things, and then I'll seal it up and we can have a little seance with Lars here. Oh, I'm just realizing did I forget the, I may have forgotten the little planchette, I think someone said it's called, the little marker thing, but I do have my magnet and quill that I can set on there. So it won't quite be your typical seance, but so that switch there fires up the feather. The feather is now broadcasting and looking for a Bluetooth device or advertising that a Bluetooth device can go and find it. So what I'll do is I'll open our Bluefruit Connect app and what you'll see here, it's gonna be a little blown out, I think, sorry, but what you'll see here, remember I posted a tip or I did a circuit playground, Circuit Python Parsec that is, Circuit Python Parsec last week about naming. So again, instead of CircuitPy9YX9, this is showing up as Ouija, which is very helpful. So I'll hit connect on Ouija and then I'll go over to the controller, which is the one I almost always use, control pad. So now I can do motor driving. So you'll see the motor is running in the forward direction. I can stop the motor and go backwards with the motor. And this is a looping motor anyway, so it's more, this is more useful for when you wanna stop somewhere where you like it, oh, sorry, this is the stop button now, and then change directions. Oh, I keep doing that, that used to be what I was using for stop. So now I'm using right for forward motion, left for backward motion and down for stop. I didn't map that to anything. You can see however, when I send any commands, the feather will respond, so you can see there's a little blink there of the activity LED to tell us that we have received a command over Bluetooth, let me put that in view. Now what I'll do is I'm gonna take this speaker and I'm gonna flip this over actually now, I'm just gonna feed the wires into that gap there. And I will just, for now I'm setting the speaker on top of this so we get some resonating out of it. And you can see here now from the app, if I want to play sounds, I can turn on background music. I can play a noise from the seance. Lars has missed you so much, he's missing us from the great beyond. Wow, Lars, that's terrifying. You'll notice also that when I play the Lars sound, so I'll hold this up here again, when I play Lars sound I have the LEDs doing a little randomized fade pattern. So sorry if that's not loud enough, it was loud enough when I was working on it and actually if I push the speaker down into here it'll be louder. So the Lars sound there, the voice, I just have one, you could put a bunch of samples on here, you can make some pretty small, I'm using wave files, you can make some pretty small wave files, they don't have to be very high sample rate and they can be mono, so the file sizes can be pretty small. So you could have a bunch, I just have the one Lars sound on there and then I have a looping this music, that loops always, the Lars sound loops once when you press this button. It stops when you hit the four, you can also let it loop through one time and just use the four to turn off the lights. And that'll all work together, so if I, let's find the magnet in here, this feather is toast, this is definitely gonna fall off of here, let's see if I can shove it in there a little better. Maybe that'll survive it. So here's the fuller Lars seance experience here from the great beyond, let's go and start that. I'll show you my controls. So now I can run it back, maybe stop it at the yes, run it forward again and just let it run and play Lars' little message. And I realized that LED, yeah, you can see them light up, I didn't want them to look like, hey, an LED is on, but I set them to a low enough brightness that they just kind of glow. Most of them were under a letter, which is nice, one of them is up by the skull's chin or the yes, I guess, if you're being charitable about it. And maybe what we'll do before we finish is try the speaker that's built in there, it could be a disaster, but I think it's worth a shot. What I'll do first, however, is head on over to show you what the code looks like for this. So let's go ahead and stop the Ouija, could stop the lights, turn off that music. And let's head over here with, I guess I need all of it. Yeah, I got to plug all of it actually, I should probably just use a long USB cable, but we'll see if we can throw everything up on here. So the best thing will be for me to feed, fit everything inside of here and it will, there's plenty of space, and then just figure out my charging of that battery or use that external battery pack there to give myself access to that or USB so that we can charge it or change out the samples on it, code it, all those things are good reasons to make things accessible and not seal them all up because I don't want to unscrew this thing every time I got to deal with it. All right, so let's go to this view of the world to be good, let me unplug that there. This guy here, and I just lost that USB cable, where'd you go? That's a USB-C, there is the micro. Okay, so here, and okay, so let's close that to open up my code. Okay, so for, let's go through this. So I've got some imports of libraries here, I'm bringing in time, random, board, so we get pin definitions, digital IO, Neopixel, all the motor stuff is in motor kit, all the BLE libraries, Bluetooth stuff I need, and then audio core, audio mixer, and audio bus IO. I haven't optimized this yet, so some stuff is probably lengthier than it needs to be, there could even be libraries in there that don't need, I don't think I'm using digital IO at all at this point. I've got some setup for LEDs, just so that we can see the blue and the red LEDs that are on the board for feedback with connection, setting up the BLE radio. My motor code was from, I ripped it from something else where I had multiple motors, DJ Devon said, I thought audio core was being deprecated, it might be I can never keep track of which audio thing we're using, sorry about that. I'll find out before this is published for the guide. Then I'm setting up the motor wing, which is on I squared C. I didn't tune this frequency, this seemed good, it's a good sort of beefy low frequency for PWM motor, keeps things moving slow and with some oomph, but you can see here, this was where I set, my maximum throttle is only going to about 65% in either direction, either positive or negative. Again, motors, this is excessive code because I'm only using one. And then I'm setting up my audio on audio bus with the I2S output, that's where I have my bit clock on the TX, my word select on the MISO and my data board, data on the RX. And those were just three nearby pins that can be used for I2S. By the way, I don't know if I've done I2S sound on the NRF 52840 before, and so what I did was we have a bit of code in one of our guides that shows you how to query all of the pins on a microcontroller to find out who can do I2S conveniently enough, and then that ran forever because there was a ton of them on this board, but I picked a set that I liked that were next to each other, so that's how I arrived at that. Then I'm setting up my mixer to have a voice count of two and that means I can play the sound of the music and the sound of the Lars voice here at the same time, and then it's just using this virtual mixer, fader arrangement to decide the level, so if I'm including having them loop forever, at least in the case of background music, it's just always looping, and I just set the volume to zero when I want it off. We're doing mono, so that's this channel count of one. You can see I've set my sample rate pretty low. Bits per sample, 16, you can probably do eight bit on this. Signed samples, I've never known what that means, but there you go, that's part of the wave file spec. Audio play, so this starts the mixer object going. I have two wave files, but if I put more in, it's fairly easy since I have this list here, so I have spookyweegee.wave and Larsweegee.wave, then I set my maximum value for the volume on each of them, they have different max volumes, and whether they loop or not, set to true and false. The wave objects are all opened, in this case, two of them, and then I set the voice level down all the way on both of them and set them to play based on their looping. Then I've got the NeoPixel set up here, actually was using some of the same, originally I was using some of the same fire code that Todd had, so you'll see the colors called fire color. Then that changed, so it's a little simpler now. The main loop here does all the Bluetooth stuff, so checks starts advertising, says its name is Ouija, that's where I'm able to name it there. Waits for a connection, so when it's not connected it just doesn't do anything, it just sits there waiting to get a connection. Once it's connected, we do all the Bluetooth setup and then we start waiting for packets, and so when I press the buttons on the Bluetooth Connect app, I'm sending packets that are gonna be either button packet right, left, down, up, or button one, two, three, or four, that's pretty much all that comes from that app. So here you can see when I hit button right, I'm just setting the motor zero throttle to the maximum throttle amount. If I press the left button, it's that times negative one, so we flip the direction, and if I press it down, I set the throttle to none, that just stops the motor. The other buttons are for sound and light stuff, so if I press button one, the background music volume is at its max, if I press button three, then it's at zero, still looping back there, still playing, we just don't hear it, and then with button two and four, which are over each other, I have both the LED show starting and playing the Lars loop one time, since loop is set to false here, and then that sets the level up and it sets the brightness to max bright, so this was a quick easy way to, again, just have the light animation happening on its own back there, no one's worried about it, it's just happening, but we can't see it because I've set my max brightness value either to zero when I say LEDs are off or maximum brightness, and this is what's happening to LEDs, so it's a simpler version of, it's not using NumPy, it doesn't really need to, I have seven LEDs here, so it's pretty fast, so here the whole group of them are being faded by the fade amount and then shown, and it's just looping through that, whether it moves on and does that to one of the seven, I just have it flipping among the seven for going through its thing, is based on this here, so when the duration is met, we grab a random one and run the code on that, so that's the basics of it, I'm gonna clean that up and neaten that up and put some comments in there, but I'm pretty excited about the final effect here, I've gotta neaten this thing up of course, but let's take one more look at that and then we'll maybe try to take over that speaker that's built into there, in fact I'll leave all this up here so you can see it all, so this is on, this is on, put the speaker down here so it doesn't get interfered with the Ouija element and let's grab, oh you know what, let me see if this works, this is a magnetic ring, that might be cool, let's see how that does, we'll get out our app, make myself go over here, or smaller how about, so here you see I'll reconnect, shows that I've reconnected, got a controller, control pad, yeah let's just try moving that ring around, that's cool, so that ring has north-south polarization around its circumference so it sort of floats on one side, it's only touching on one part of it, I could probably, yeah it just wants to sit there, that's where it's happiest, but that's kinda cool, it does some weird, weird motions and we can reverse that, hit back that way, and these magnets are strong enough, I think I demonstrated last week, you can hold this thing vertically, you could probably mount it on the wall and a light object with a strong enough magnet, it's not too strong that the friction is too great, we'll stay stuck to it, which is cool, I can stop that, play our music, all right we'll stop it there, we've got another question in the chat which is a really good one, switch over to my code view again, well here's the question, DJ Devin said, what is LED bracket, colon bracket, I haven't seen that syntax before, if you look at the sort of more typical for loop version of that, and I have that in the fire code example that I showed before, so let me plug this back in and open that up, I have both versions in this one, let's see, go here, I'll close that code and I'll open the code on this little fire guy here, so this right here, for I in range number of LEDs, and then RGB are cast as the current LED color that just asks for the value, and then they are clamped from zero to 255 as each component is faded down a certain amount, in this case I think it's by minus one, and then the LED value is set to be that new faded RGB, that is the same as this line right below it, so LEDs equals min max, I plus fade by clamp zero 255 for I in L, for L in LEDs, I would never come up with that in my life, this was the example straight from Todd's example code, he explained it essentially as being a much faster way, if you have a lot of LEDs it'll matter, you won't notice in this code, but it is a much faster way to kind of cast those LED values in a big chunk rather than one at a time like this, that's the best explanation I can say, let's see Todd wrote in the comments, LEDs bracket colon equals some new list means copy every element of the new list to the existing object, and I think it happens quicker versus iterating it one at a time, here's the example from Todd actually if you wanna see it rather than me say it, so there's an example of that, list slicing using brackets is C Grover's explanation of it there, I may do a tip, if I understand that better I'm gonna spend some time with that, I may do a tip on that one and look at the differences between using that list slicing versus the typical for loop, good question, I hope that answer at least doesn't confuse you more, but bug Todd and C Grover about it in our chat if you have more questions on that, okay so last thing I wanna do is let's see what happens if we hijack the speaker that's built into this thing and this by the way, sorry before I move on too quickly I didn't mention what's the deal with this ring, this is pretty cool, this is used for certain magic tricks, it has a north and a south polarity that is I think strongest in this direction, sometimes these tend to be strongest in this direction but I think this is designed so that looks like a normal ring, you can use it for magic tricks that have some, I won't spoil it and say which ones, but if something like a token or a dice or something in a box can be encouraged to go somewhere with a magnet, this is the way, so something can be held and then revealed and a thing is moved or you've made an event with a certain outcome using a magnet, so that's what those are, you can get those pretty cheap. All right so let's jump back over to the bench cam here and let's take a look at what happens if we swipe the speaker leads from inside the cabinet. All right, so I'm gonna turn this off and set the motor part and the LED part aside over here. You can see too during this prototyping stage I tried to make pretty long leads on things just so life would be easier when flipping the lid open and out, I didn't wanna make things small and compact until I decide how it's going in there. So the speaker, yeah, okay, why don't we try it? Let me fire up the soldering iron over here. I think what I'm gonna do is just desolder the speaker from the board here. I have pictures of where things go, so I don't mind. It's these two white, sorry for the bouncing camera, calm, it's these two white leads here, it's probably not polarized, but I could get those put back together later if I need to. So I will just try to desolder those from there, not from there, what am I doing from up here? I bet you were yelling at me, don't do there. And I can just take my little I2S amplifier which has screw terminals on it and you can see here again helpful during prototyping I just have this thing socketed, so I can pull that out, just make life a little easier, take that speaker off of there and we'll put the existing speaker back. These are gonna be a pain, they'll wanna slip out of here because there's such thin wires, they do have a little bit of solder on them which helps them at least have a lumpy end that might get squished down in there, but I do prefer to put crimp connectors on these kinds of things or other ends on them even with screw terminals. Screw terminals can lead to sadness sometimes when things slip out of them. All right, that seems like a good connection. So let's find out if that works. Everything close enough here, okay. So I'm on a truth, I'm gonna fire up board and let's reopen the Bluetooth app here, see what it sounds like. It could be horrible, who knows, I don't know. So since that was powered off, it lost the connection so we'll just reconnect. It's been very good about finding that connection though which is nice. Okay, so let's play the music, not bad. My mic a little closer, so I could up the gain both in software and on the chip. I'm also gonna just check if I put the lid on. Does that alter it at all? Not distorted or anything, so that's a plus. No, I don't think that adds to it. I'll play Lars. Oh, well there we go. I was muffling it entirely. So the speaker is open on the bottom. So it's using this as a sound board to resonate but it's also got an opening there. So here's just Lars. Yeah, it sounds good, it actually sounds better than what I had with other speakers. So that's nice, here's the music again. And I just gotta put probably some rubber feet on this so it's just lifted up a tiny bit on the work bench and then you probably get some nice sound reflecting off of the surface it's onto. That's not bad at all. Yeah, it's better than it was with the other speakers. I'll keep that one, very cool, nice reuse. And then I can mess around with the volume in the code. If I had more buttons on this or wanted to maybe mode switch with one button, I could also tune the volume in here but I think it's just something I'll change one time in the code and then leave it. All right, so let's stop that. Where'd you go? There we go. And that's about gonna do it for today. So hopefully that'll inspire some Halloween hacks. I like doing this every year, go to the store and find some animatronic and see what we can do when we give it a better brain. I'll thank everyone for stopping by in the chats. There's a lively discussion going on right now about remembering which legs of LEDs are anode and cathode, so go check that out and other discussion going on over there. Hi, Katnie, thanks for stopping by the show. And everyone else, Janiske, Todd Botte, DJ Devon Three, who else is over here? Sir Prince a lot. You like big prints and you cannot lie. Andy Calloway, Johnny Bergdahl, sorry if I missed anyone, but thanks again for stopping by and I will see you on Tuesday. I won't be doing a show next Thursday. No workshop show, but I will be here Tuesday for a product pick of the week, so please stop by for that. And please check out some of our other shows. Tim C is doing some cool stuff on his deep dives and I believe he has one tomorrow. So there's some cool Bluetooth stuff going on, I think, or Wi-Fi, I can't remember now. I think it's, is it Wi-Fi using? No, I think it's Bluetooth on the Pico W maybe. One of those, Bluetooth or Wi-Fi that Pico W has been doing. And then we have our whole slate of shows starting again next week. So please stop by and jump into our Discord if you wanna find out when shows are and talk to people during the shows or not during the shows. All right, thanks everyone. And for Adafruit Industries, I'm John Park. This has been John Park's Workshop and I will see you next time. Bye-bye.