 One second. Yeah, look, have audio. Sorry about that. That's a great entrance to make. Just walk right in and say nothing. Hmm. Hi, welcome to the show. It's me, JP. This is John Park's workshop right here on Adafruit TV. We don't really call it that. And thanks for stopping by. I see we've got some people over in the chat over on the YouTube. Hello, everyone. Nice to see you. And let's see, I'm going to put on my glasses so I can read the chat because that's not going to do just guessing what those people are saying. Hi, Dave. Hi, David. Hey, Dale. Hi, Connor. Larry, what's going on? Dave Lindy says, just notice the bottom right corner. I didn't already hit that. Did I? I did not rage quit. I am here. But we are going to talk about rage quitting today and build a device for rage quitting. And if you're wondering what rage quitting is, we'll even talk about that. But you can probably guess from the name. And hi, thanks, everyone, for stopping by over in the Discord. If you are wondering where people are chatting from, that's a lot of our chat right there. So if you're tuning in on Twitch and it looks pretty quiet around there, or Periscope, or LinkedIn, or one of the other places that we're broadcasting, you might want to head to Discord. It's there. You can go to Adafruit.it, Adafru.it, that's our URL shortener, slash Discord, and you'll get an instant invite. And then you can hop over into the chat and say hi to all these nice people, including Bruce, Mr. Certainly, who's waving to his mom saying, hey, I'm Adafruit TV. Very nice. Well, thanks for stopping by. So let's have fun today, I say. We've got fun stuff prepped. And some of it's going to be on the fly because I came up with part of this idea at the last moment. And so I was trying to set up a laptop over there to see if we can do a demo, and we'll see how that goes. It should be exciting. First of all, let's mention our jobs board. We've got a jobs board and it is at jobs.adafruit.com. And if you head over to that site, jobs.adafruit.com, here's what you're going to see up at the top. In fact, there's a link for not only search jobs, that's the default, but available for hire. And if we click that and scroll down, you'll see that there are a lot of people looking to pick up work. So if you are looking to find someone to do something for you, head on over there. If you are looking for work, head over to search jobs. I saw kind of cool one in here. It was a, where'd it go? It was a, someone to build a rhythm machine, like a solenoid drummer. Did I make that up? I thought I saw that earlier. Let's see if I go back a couple steps. No, it's gone. Anyway, search through there. Maybe that job's already been filled. You better hurry if you're looking for a cool job, because apparently they go quick. So that is jobs.adafruit.com. Go check it out. Let's see. Next up, so as you may or may not know, on Tuesdays, I do a different show that's called Product Pick of the Week, JP's Product Pick of the Week. It actually looks a lot like that. That was this week's Product Pick of the Week, this rotary trinky. And if you tune in on Tuesdays, you can get a 50% off discount typically on the Product Pick of the Week. That was the case this week. And that discount is only good during the show. So you should tune in. It's on at four o'clock Eastern time on Tuesdays. Last about 15, 20 minutes to some demos. And this week's one minute reduction looks like this. Rotary trinky. It is a USB plug and play rotary encoder board that also has a neopixel for feedback and a capacitive touch for additional input. This sends USB HID commands. I can adjust that frame forward, frame advance, one frame at a time. I programmed this to turn on closed captioning when I click the little button. I've also set the cap touch slider as a play pause. It is the rotary trinky. It's a USB rotary encoder that plugs right into your computer and allows you to use a rotary encoder, click and touchpad. That one's on loop. We're just going to watch that all day if I don't get on the controls here. Let's see. Next up, what I've got for you is our circuit python parsec. Am I really muted again? All right, I get to go through this the second time. Thank you, everyone, for letting me know in the chat. Good. I didn't really want to be on the side of this thing anyway, so let's arrange this a little more nicely. Hold on one second. I've got an idea. You get to put up with me fixing something here real quick. Let's duplicate that. Workshop charades. What is he even talking about? Let's see. If I put that there and that there and hold on that there, that there. Yeah, that might work. I'll scoot that just a little bit. Hold on. We've almost got this. I thought I had this set up already. Pardon me. No, I don't want to move that. I want to move this. All right, that's going to work. All right, there we go. Get ready for it. Here we go. What is this thing? For the circuit python parsec today, what I want to do is talk about pulse width modulation. Pulse width modulation is a way of faking an analog output where rather than smoothly sweeping through voltages, we make very fast little steps that look analog to the eye. But the way they work is that we're essentially flicking a light switch on and off real fast. So the full on and full off, if we change the amount of time between those square steps, then we can average out to different voltages. So you can see here in my code, what I have is I'm importing time so we can pause, importing board so we get pin definitions, and I'm importing the PWM IO library. Then I'm setting up this pin on the LED pin, which is a PWM IO output on one of the board's pins. In this case, I picked a convenient one, the Mosey pin. And then we're setting a frequency as well as a duty cycle. Then we set the duty cycle to a particular value when it starts up, which is about half, which would approximate a one and a half volt being sent to this LED and the resistor that's there to protect the LED from over current. Then in my main loop, all we're doing is stepping through, increasing and decreasing the spacing between these full on, off square waves, which as those go in and out of phase or speed between them, we get this approximation of a smooth voltage. So you can see here in the case of this little cutie pie, I've got a big fat LED on there, and it looks like it is nice, softly, gently changing its values like you'd expect an analog output to do, except I'm not plugged into an analog output at all. I'm just using one of the regular digital pins and essentially triggering it on, off real fast. And so that is how you can use PWM in Circuit Python. And that is your Circuit Python parsec. Yes, someone mentioned in the chat that maybe setting up a rage mute rather than a rage quit would be good. I should have a big button for my muting. Maybe I need a huge knife switch right here for mute. So I always know. All right. So if by the way, someone had a question about, I think someone had a question about the PWM. If you want to head over to the learn system and you check for Circuit Python essentials, there is a link on the left for the PWM talks all about it and talks about the duty cycle and frequency that you use. And you can use this for things like servo motors as well as LED. So there's a number of different ways to use PWM to send something that seems like an analog value. So I hope that's helpful. Let's see. What's going on next? Okay. So I think, are we there? Yeah, we're there. So let's talk about a project of the day. So first of all, I mentioned that I want to make sure that we end on time today because Scott is going to be doing a deep dive at two o'clock. And I probably won't go that far, but yell at me if it seems like we're going long. So for today's project, I teased it here as this big rage quit key. So first of all, rage quit is what it sounds like. It's a word used by gamers to describe getting so mad at something that's happened in game that you just quit the game entirely. Sometimes you send a nasty message on the way out. Sometimes you just hit alt F and get out of there. So on Windows, the alt plus F4, the alt F4 will kick you right out of whatever application is currently sort of has focus or whatever app you're using. If I were, I'm on Mac, but if I were on Windows right now, broadcasting right now, my broadcasting software has focus. If I hit alt F4, bam, I would go away. So on Mac, we can send the keyboard combo command option shift escape, and that will do the same thing, not as sexy to say it's alt F4, but that will just boom, boot you right out. And as you can imagine, if you want to, in some games, there are ways to automate things like sending a message and then quitting the match and then restarting the match or quitting the game entirely. And so you can probably see where I'm going with this, which is we can do USB HID, both keystrokes and writing keyboard commands to send kind of anything we want. And so using something like, I'll unplug this one here, using something like this little QT pie that I had for the previous demo, you plug that into a USB port and you've got an instant rage quit machine, but you'll want some buttons on there, you'll want a way to fire that off. Davo Desa mentions he had Boss Key. This is another name for this where you were playing Doom and you had to quickly make it look like you were doing a spreadsheet. So often there was a keyboard combo to switch away from the app or put up a fake screen or something like that. So Boss Key or Alt F4 or Rage Quit, that's what we're going to make. Now, you know I love the mechanical key switches and I've been doing a lot of projects with these little guys. So here's one of the Kale box red linear key switches, nice little key switch here. And so I want to do something with that. And as you can imagine, we could set up something like our QT pie and this key switch. We've got our feather, two button version of that sort of thing as a feather wing. We have the, let's see, I don't think I have it right here. Let me grab it. We have our Neo Key Trinky, which would work pretty well. That just plugs right into your USB port and you can use that. But for something more satisfying, I wanted to try a different build. So let me switch to my workbench over here. So you can see I've got another key switch. This is a Kale. It's also a linear key switch. But the big difference with this one is that the scale of it is just a little bit different. So as you can see, this is one big honking key switch. It's actually, if I grab my regular Cherry MX compatible Kale key switch, you can see there's a bit of a difference in size there. This one is four times larger in all dimensions. So 64 times larger in volume than the poor little regular one. And it even comes with a gigantic key cap. So you can see right there that is a satisfying, that is a satisfying key switch for building our Rage Quit machine. And so what I wanted to do first is show you kind of how I want to approach integrating a microcontroller with this so that we can send the key command from this big, gorgeous, beautiful switch. And by the way, a little word about this for a second. This is from Novel Keys, a company that makes key switches and partners with Kale often, K-A-I-L-H. And if I head over to my browser here for a second, this is the big switch series. These are out of stock right now, but you might want to sign up if you're interested in finding out when they come back in stock. And they make the yellow one I have, which is linear. They make a tactile bump one, which is the red one. And then they have a very clicky blue one, which is the one here on the right. And these were on mass drop at one point. They have some really nice photos of it. Colin Cunningham made a project on the learn system using a set of these, and he built a nice stand. Let's see. How about box switch? No, key switch. How about key switch? Colin. Colin? No, Colin. I found it anyway. So here you can see the circuit playground express here. And he's wired up the three switches. So this is really cool, nice macro keyboard here. So what I'm doing is a variation on this. And I love this stand and sort of macro keypad, giant macro macro keypad that he's built. I was curious though, since these things are so big, could we actually fit the microcontroller inside? And spoiler alert, the answer is yeah, pretty much we can. So what I've got here is a, zoom in a bit more here, if I can, I should do it. So I will, maybe I'll take one of these another time for you. So it's a little, it's not too hard. It actually opens just like a real key switch, but I found it works better to use a spudger. And I kind of don't want to pull it apart right now. But it's identical to a real key switch on the inside. And these are the two contacts here that are closed when this is pressed down. So this just shorts a digital pin to ground is how we'll use it. One other note I'll make is that they've even designed this to use a large LED. So this is this is how an LED on a traditional LED, not a RGB neopixel style one, but a traditional LED key switch like on your cap slot. The Cherry MX style has a little slot here for a, for an LED. And I just, I put a coin cell over here that I could hook this into just so you can see it light up because that's fun. So there it is all, all glowy. And if I can get that to stay there, I'm going to put my key cap giant key cap back on there. Look how satisfying that is, huh? Big and glowy. So I think ultimately what I'm going to do, I probably won't do it today, is add a neopixel. And we've got some eight millimeter RGB neopixels that are this style look like a gum drop style. So I have a little, I'm going to order a little set of those after the show and add that to this build so that we can do RGB under lighting. Since this is a nice clear key switch, you can actually also light it from below. So you could put a small neopixel ring maybe under the, the stem there if you wanted to. But what I'm going to do is you can, I think Colin might have soldered to these or use alligator clips. What I found is that our terminal connectors for arcade buttons actually fit pretty well on these. And if you bend them, you can attach them, let me put them like this, you can attach them with pretty good clearance just by sliding these onto those terminals. That's how big and fat and thick those things are. So if we get those on there like that, now we've got a couple of wires that I'm running, again, to ground and the, I think, MO, MOSI pin, and then using that as a digital pin, not as part of SPI. And then if one thing I noticed taking this apart, pretty much all of the inside of the switch here gets taken up by the stem as that moves down. So you can't really put much inside inside it. But there is this little cut out here, which is where some underlit LED light tends to come through, depending on the design. That actually has just enough space to fit our, and let's see, how did I have this? I think I flipped this over to eat up some of that wire length. So that'll fit with one of our new little right angle USB-C connectors. That's often the trick with these things is how to get the USB-C plugged into something that needs to be in a tight space. And then there's actually still enough clearance there for, you can see that little yellow tactile bump tab. It's actually not used on this particular key switch, but that now fits. So I'm going to tuck those wires in like that. Tuck this back here like this. And then right before the show, I 3D printed a little stand I made to try to allow, because right now this thing isn't going to stand on its own. This thing is a little wobbly, because it's meant to pretend to be mounted in a PCB. But these have like a little couple of tabs that spring in and out to click into place. Let's see if we don't break this 3D print. Hey, there we go. So now we have kind of a nice little stand. It still shows off the insides, because it's kind of fun to still see that rather than hide it in a box. And then we can set that right on there like so. And now we have a nice stable button. So you could use this, let me switch my cameras speaking of using switches. So you could use this for something like a mute button if you want to. You could use it for an app switcher. You probably could go as far as to code it to do different things based on patterns. So if you want to maybe hold it for a second first and then one tap, you might be able to write your code to do more than just one thing with it. But I'm just going to do the rage quit thing with it. So let's demonstrate that. And I'll show you the code that I worked up for this. It is straightforward. And that's one of the nice things about once you've started doing some of these USB HID projects is that they are very, very similar. You can get away with reusing code really nicely. Let me rearrange some cameras here so you can see this big honker as I code that. Let me turn a camera to the side there. And how about that little view there? Got some blue tack from the last thing. Look at that. Yeah, I can't wait to get an LED in there. I just didn't have time today, but I will. So I'm going to plug this in and this is dangerous now. In fact, I'm going to click on something else. I'm going to actually launch text edit. So I just have that off in the side. I'm going to make sure that has focus when I plug this in just in case I've done something wrong and it rage quits it. It did not. Okay, that's a good sign. And so let's take a look at the code for this. So I'm going to pop up my atom here and let me move that other window real quick for you. Where is it? There we go. Okay, thanks for your patience as we set up cameras. So I'm going to open up the code that's on that board. This is it actually. So the code that I have on that board. Let me see if I can scale that a little bit. Read that. All right, more camera juggling. There we go. Now we'll be able to see it. Okay. There we are. So here's what we do. Import time in case we're going to do any pausing or things, especially with the neopixel, I haven't got that in there. So right now it's unnecessary. Import board so we can have the pin definitions using digital IO to read that switch. I'm importing neopixel, although I'm not yet using it. And then I'm using the Adafruit debouncer, which I love for this kind of stuff. It makes your life so much easier when just checking to see have I pressed a key and have I released a key. And then I'm importing the USB HID, the keyboard, keyboard layout and key code. And with those three things, we can do individual keys, we can do a macro set of keys that are a keyboard combo. And we can type stuff out. Then I'm setting up the key switch input as this digital IO pin on the board's MOSI, MOSI pin, as an input with a pull up resistor. And then setting that up on the debouncer as big key switch. Then I set up the keyboard. And then this is the code. While true, we update the debouncer. That's what that big key switch dash update is. The debouncer just checks to see, hey, has anything happened? If it falls, meaning it's been pressed, then we're both going to print the word press. And we're going to run this keyboard combo. So I'm doing command, option, shift, escape. And that is the magic combo on the Mac. Don't try it now or you'll blow up your browser. It'll go away real fast. And then that's it. And I'm actually not using the keyboard rise for anything right now, but I probably will once I set up the neopixel. So to demonstrate this sort of safely, what I'll do is I'll create a new screen capture. And let's put that on this layer. New screen capture. And I'll just, I'll do a monitor capture actually with this one. Just give it one second. Okay. So if you look here, I've now given this text edit focus. And I'm just going to type rage quit in there. How big does this go? Rage quit. There we go. So when we're ready to rage quit. And I'm going to put, I'm going to put this on a different layer for a second here so you can still see my key switch there. Okay, so I've got this app as the forward app. I come over here, I press boom, and it's gone. That just decimated the app. It just, it doesn't ask anything. It doesn't say, Hey, do you want to save? Oh, it's just gone. So perfect for when you get mad, just capoom. Someone asked, does that combo bring up the force quit dialogue? No, that's command option escape. So it's the addition of the shift that takes no prisoners and asks no questions. So yeah, command option escape will bring up the little force quit dialogue on the Mac. This thing, which Todd bought told me about earlier, because I was running this idea past him, command option shift escape, that is the closest to the alt f4 on Windows, which does the same thing. It just blows the current focused app right out of the water, which is awesome. I don't, I don't know if it'll work as a force quit if something is hung, it may also. Let's see, Dave Lindy says command w or command q may be closer analogy to alt f4. Okay, I may have these a little bit off, but this will definitely do the job if you're mad at a game and hit it, just don't hit it a bunch of times because it'll just keep deleting or closing every app that you get to. So let's see, let me, let me check the chat. Any, any thoughts or questions? You're probably yelling at me like, don't do this, this is unsafe and terrible. Let's see, hey Discord. Let's see, Todd bought you, you just got a note, no spamming thing from the bot. What did you do? Oh, you're saying the same thing over and over again. You can't do that. Our Discord bot will get mad at you. Let's see. Yeah, Dave Lindy's, I didn't know about that one. It is good to check every once in a while about new, new keyboard shortcuts for the OS because they seem to, to come with new updates. Yeah, someone found a link to those. Todd bought us this Adafruit going to make a huge trinket for that. Can you imagine you just rip your USB port right out? This is a bad idea. Look at this thing. It's so satisfyingly big. I'm going to unplug it, actually, for safety. I'll show you it up close with my little table there, little coffee table side stand thing for it. And then I just wanted to try and see over on, I didn't get this set up in time, I think, but let me, let me run back over to the, to the workbench and see if I got this Mac to run Fortnite, which I thought would be a really good one to, to Rage Quit. No, it didn't. I only got that far. Okay. But yeah, we can, we can blow away this. So I'll show you this is zoom out a bit. So you can see here, we'll just plug in our little USB cable there. I really like these new USB cables. There it is set up. So whatever app we've got forward. Oh, did it not close it? Am I not plugged in anymore? What happened? Didn't work at all. Did it not actually recognize my, oh, there it is. Yeah, I didn't plug it in fully enough. This is kind of an old laptop. So it's got a bit of a janky USB. There we go. All right, so that should work now. Boom. Chrome is gone. What else can we launch? Let's take the terminal out. Will that work? Should. Boom, gone. So too much fun. Of course, it's highly dangerous because people will walk up to your desk and want to hit it. So maybe only plug it in when you're ready or have other switches on it so that you can toggle it on and off or modify it. I looked around briefly and I've seen there are definitely other cool projects with this kind of idea in mind. So look around. I saw someone had a selector switch on theirs. They used a big arcade button and they had a little selector switch and three LEDs to say, are you quitting happy, medium, or angry? And depending on which, it would send, I think it was like Starcraft or something would send a message that was nice, neutral, or not so nice before quitting out, which is kind of funny. Naradak asks, how about a giant kiddie paw, toe beans key switch? That would be amazing. Doctors say, I want that. Where get? Yeah. So go check out. Tell novel keys. We want these back in stock. I don't know. It's been a while since they've had them in stock. So hopefully there's enough interest to get them to start making those things again. And what else? I think that's going to do it. Yeah. So the main addition to this from now is to do a neopixel. Trying to see if I have those RGB neopixels that look like a big gum ball kind of one. See, I've got plenty of these. These are these nice 10 millimeter single color ones. And those will work great too. And that's actually a little more accurate to what a, or could use this crazy three watt thing and just melt your key cap right off. But yeah, that key switch is designed to have a through hole LED running right up through. It was the original style of like the Cherry MX. So it's more of a modern invention to put these neopixels underneath them. All right. I think that's going to do it. So thank you everyone for stopping by. I will be updating this and putting together a learn guide. And of course, one of the things about this is that, you know, it's a lot of fun with this particular switch, but you could use any kind of arcade switch you want. These terminal lugs that I'm using here to connect the wire actually meant for arcade buttons. So you could do this as an arcade panel type of thing, oversized arcade button like we have in the store. So there's a lot of options there, but this one's a lot of fun. Listen to that. So big. All right. Thank you everyone and stay tuned for Scott's Deep Dive at two o'clock. That's in about 22 minutes from now. And that's going to do it. So I will see you next week on Tuesday for another JP's product pick of the week. And I will see you next Thursday for another John Park's workshop. Thanks everyone. Bye bye.