 That's fun, right? I had everything perfectly set up except for one thing. That's all it takes sometimes. Hello and welcome to the show. It's me. I'm John Park. This is John Park's workshop. You are you, and you are part of our Adafruit community, so we are really excited and happy to have you joining us here today. Hi to everyone over in the YouTube chat. I see you. Anthony Becerra says that they have put together their macro pad. Hey, that's cool. We're going to be talking about the macro pad today, in fact. And I think the YouTube stream is catching up now because I'm seeing people saying, no sound, but now sound. So sound is back. In fact, I even set up a little something that I'll show later with the macro pad to maybe help me with my muting and my unmuting. It'll work something like this. Oh, you know what? I don't have it plugged in right now. I'm not going to attempt to fade. We'll do that later. Later. Later. Later. Let's see. What else is going on? We've got some fun stuff planned. I'm going to talk about some job board stuff, some product pick of the week stuff. I've got a circuit Python parsec for you. What else? And macro pad things. And then I also, taking a cue from the Ask an Engineer show, if you've got any questions, we can do some Q&A either during the show throughout or at the end. If you've got any questions, go ahead and post them over in our Discord chat or in YouTube. Those are the two I'm watching. So if you're on, if you're watching on Twitch or Periscope or LinkedIn or one of those other great places, awesome, Facebook too. But I'm not watching the chat on those because I only have so much attention I can spare on different chats. So best place to go is to the Discord. It's at the adafrew.it slash discord. If you head to that URL, you'll get an invite. You can join in the Discord. And look, this is what it looks like. If you head to the live broadcast chat channel. In fact, let me show you. Let me show you this real quick. I'm going to do a little adjustment here on the screen share and shoot that over there. There you can see that is what our channels look like there. So we have live broadcast chat. That's what, that's where you usually find people during a live broadcast. But then there's a whole slew of other channels that you can check out, especially these help channels are terrific. If you have help questions for any of these types of topics like CircuitPython, Arduino, 3D printing, audio, Raspberry Pi and so on and so on. Those are great channels to go and check out. And it's, I don't know, we have somewhere over 25,000 members, I believe, of our Discord. And there are people on there 24-7 answering questions helping each other out, making each other laugh. So I encourage you to go check it out. And that's the Discord. So that's that's what I'm talking to over there. Hello Dexter Starboard. Hey, Rich, Sad. Hi, Doctor. How are you? BlitzCityDIY. Nice to see you. Andy Calloway. Hello. I think I saw C Grover. Hey, C Grover. And question over, first question is in YouTube. Someone asks, any relation to the park brothers of DC fame? I don't think so. I don't know who those park brothers are. So I'm going to say no. Not. All right. So next thing I'll mention is we've got our job board over at jobs.adafruit.com. So if you're looking for work, there are worse places you could go than heading over to jobs.adafruit.com. This is it right here. If you head to jobs.adafruit.com, it's a free job board. You can look for jobs there. You can post your resume if you're looking for work. Here are a few new positions up at the top here that might be interesting to people. I saw this one jumped out at me. Circuit Python Coder needed for Adafruit Matrix Portal. If we click that, that went up just yesterday. Someone is looking for help with doing a 64 by 32 LED matrix using the Matrix Portal and Circuit Python. And they want to be able to show some finhub.io, stockinfo, and nomics.com crypto data. And they have some project examples they show. It's based on something that actually a good friend of mine, Mario Cruz, who is one of the people behind the Miami Maker Faire. It looks like he had a stock ticker project that's being referenced here. So really cool position. If someone's looking for some freelance work, that's a good place to check it out. And this person's looking for bids. So you can bid on how much you want to make to do that job. You probably want to get more details first. But that is just one position that is up right now on jobs.adafruit.com. So go check it out, won't you? And since I said I'm going to keep an eye out for question and answer on the Discord, I actually better do that occasionally. So I'm going to just check in on the Discord. Let's see. No question so far. Good. We're safe. OK. But I don't mean good. I mean, ask some questions. Maybe some easy ones at first. I don't know. All right. Next up, look, it's sort of a show within a show. This is a recap that I like to do about my Tuesday show. So just two short days ago, right at this time, I was running my JP's product pick of the week show. Every week, I do a product pick on Tuesdays at 1 o'clock Pacific time, 4 o'clock Eastern time, about 15 minutes to half hour. And I'll go over a new product pick, show you a little demo, how to use it. And there's usually a deep, deep discount on the product of the week during the live stream only. So that disappears after the live stream. There may be discounts at another time or coupon codes, but this one, this was 50% off on this week's product pick of the week. That is the product that I picked this week. It's the RP2040 QT Trinky, which is just a plug-in Trinky. And you can use it both as a circuit Python device as well as with Blinka to use Python on your computer. And here is a little one minute recap. The Trinky QT 2040 is a USB key and a QT RP2040 all in one. I have a magnetometer plugged into it over the STEMI QTI squared C. And then I'm going to go ahead and plug it into a hub that's plugged into my computer. I'm going to run Python code on the computer that is then using the USB connectivity of the Trinky to access the sensor here. So if I take a magnet and go ahead and move it towards and away from that little magnet sensor, you can see I have the values changing in the little terminal there as well as the NeoPixel that's built onto the Trinky updating and increasing its brightness or decreasing its brightness. So that is one really cool way that you can use the Trinky which is as a sort of go-between for your Python on your computer to talk to circuit Python-based devices. It is the Trinky QT 2040. All right, yeah, so that was our product pick of the week and you can still get them, I think. They were running low on stock the last I checked, but you can head on over to the product page and look and see if that's still available. Otherwise hit the notify me link and you'll get an email as soon as they come back in stock. Let's see. The question I got over in YouTube is, JP, do you know if Adafruit are going to make the wireless NeoPixels? That is, I think you may be referring to the inductive charged or inductive powered, induction powered LEDs that Lady Aida showed recently. I do not know if we're going to carry those. Those are, I believe, single color. I'm not sure if those have a chip in them to do any multi-color stuff. They could, but those actually have a little inductive coil, just like an RFID tag, passive RFID tag does, and then there's a large coil, inductive coil that charges it and lights up the LED when it's in a certain range. It's a really cool. In fact, I think I've seen vests that you hide under your clothes that have a coil like that for use in certain types of illusions and magic tricks. It's kind of a cool thing to see the raw parts of that. I hope we carry them. Yeah, that would be really cool. The doctor says over in Discord that those are single color, no chips. I don't know if there's a reason you couldn't. I don't know if the power consumption of the chip makes that a little harder to do. Maybe you could have a capacitor in there to store up some of that power before it lights it up. Anyway, those sometimes, so one thing that Lady Aida does a lot is source cool stuff. In fact, she is a really, really like ninja level at sourcing things from Chinese parts suppliers, and she gets in a lot of stuff to check out, and then some of that ends up in our store. Some of it ends up for one reason or another not going to the store. In short, I don't know, but I hope so. Those look really cool. A lot of fun. Let's see. I think that was the only question I saw. Yeah. Okay, so let's see. Next up, we've got our circuit Python Parsec. So get ready for this. All right, so let me get set up here. I think I've got it all set up. Yeah, okay. Looks good. For the circuit Python Parsec today, I wanted to show how you can read a rotary encoder inside of circuit Python. This is really straightforward thanks to our rotary IO library. So if you look at what I have here, I'm using one of our trinkets that's made for running a rotary encoder, but you could plug a rotary encoder into most any micro controller. It just takes ground and two pins to read which direction it's being turned. There's little internal switches that open and close. In this case, this one's purpose built for it. What we do in circuit Python is we're importing the board. So we have some pin definitions and we're importing rotary IO library. Then with that rotary IO library imported, we can do this encoder, which is the name I'm giving this, just easy to reference the encoder. This is the encoder object equals rotary IO dot incremental encoder. And then we point to the two board pins. In this case, the board pins are named wrote A and wrote B, which is super convenient. Sometimes that'll just be a general purpose IO pin or a digital pin. And that will set it up. It's going to work at this point. Everything else is just how do I want to use it? So I want to print out when it turns its position. And I only want to do that when I turn it so it's not constantly flooding. And that's why I have this variable here called last position, which is going to store the state of things. So it'll only update when it changes. Then this is the main loop of the program, while true, if encoder dot position is not the last position. So encoder dot position, that's all you have to ask for to find the value of what the encoder is doing, which way it's turning. And we can then compare that to that last position it was at. And then we know we're going to do the next thing if they've changed, which is print that encoder position. And then we update that state of the last position. So you can see here, as I turn this little knob here, that's turning that rotary encoder shaft. And that is being read by the little trinky there, microcontroller is noticing those changes on its two pins, the rotary A and rotary B pin. And then I'm printing out there that change. So you can use this for things like volume controllers, you can use this for things like MIDI CC, for mouse control for moving a mouse on one axis. It's a lot of ways to use it. But it is dead simple to use. And that is all it takes to read a rotary encoder inside of Circuit Python, using the rotary IO library. And that is your Circuit Python Parsec. Tremendous. I love how easy that that has become to use things like rotary encoders. There are, by the way, a lot of these rotary encoders, I didn't show this, but a lot of these rotary encoders have a second little secret up their sleeve, which is they have a push button. So let me move this one to camera. So this one, you can actually click the knob down and it has a button that's read just like any, any digital button, digital input button. So it's actually separate from rotary IO, that library doesn't actually care about that. That's a separate set of pins that are being used over there. Let's see, what else? See Grover says it's possible to preset the encoder position value. Oh, yeah, so if you're using it for something like a volume and you want to start at when you boot this up some preset because these encoders are called sometimes endless encoders because they will spin forever in either direction. They don't have stops like a potentiometer does. So sometimes you don't want to start them at zero. So you can actually tell it, hey, you're, you're sort of relative starting position is going to be in this case, let's say 12. And then when I turn to the right one, one little notch will go up to 13. If we go left, we'll go to 11. So also sometimes those are those directions are not what you would expect. So depending on the board setup, the encoder may decrease as you turn clockwise and increase as you turn counterclockwise. It's easy to change that encode this in this case, this one set up to work the way the way that I expect it. Although I'll show you, let's let's jump back here for a second. This is a little experiment. I think with this one, if I just change the pin order, so if I say, let me increase the scale of that a little, you can see that better. So if I tell it to actually read pin B wrote B first and pin A wrote a second. And then I'm going to hit save this is going to resave my code to the board. And now when I turn this to the right, you can see it's going in the negative. So it's subtracting from the original position. And the positive is counterclockwise. The let's see, actually, I want to try what see Grover said you can do encoder dot position equals okay, so we can give it a starting position. Let's do that. encoder dot position equals 12. Gonna hit save. And now you'll see when I start turning it, it's moving from 12 as it's starting point. I'll flip these back to the clockwise is positive setting. And now if you're using this particularly if you're in something that has let's say some graphical levels and some software and you're sending it either incremental arrow keys to bump a value up that often works or something like MIDI CC values, we can start at at something, in this case, we're starting at 12. And now we're going back down to zero and we'll go below. You can also do things like set the range to clamp at certain points. So it never goes lower than a certain number, never goes higher than a certain number. That would all be in software, the encoder doesn't care, just keep turning. And you can you can remap those into different ranges. There's a lot of neat stuff you can do with your code once you have this basic thing working of reading your encoders. So I'm a big fan, big fan of these. And this one actually is a grab a Alan hex driver here. This knob here is go to a bigger view for you. This knob is on here with a little set screw that clamps it to the D shaft. Do I have the right size? I don't think I have the right size Alan wrench. Oh, there we go. No, one putting on glasses. Are you going to fit? No, that's too big. Hold on. This is a knob that Adafruit sells, by the way. I've disconnected it now. I definitely this is definitely not the right size either. Hold on, how did I get this on in the first place? I swear it was one of these. How about you? How about you? Haha. There we go. Sorry about that. Yeah, so that was a two, a two millimeter socket. So these have a little usually have a little D shaft on them. And you can use either a D shaped knob. These usually ship with a little soft touch rubber knob, go into my bin of knobs. I don't have one of those in here. But you can see something like these little jog wheel knobs will work on those. And those have a little D shaft shape. Here's something I pulled off of some old piece of equipment. And same thing, it has a little D shaft there. So those will all slip onto there. So you can get some cool knobs onto there other than just that default. Usually, by the way, you don't want an indicator on these. Since they are endless, that indicator doesn't isn't very meaningful, usually. So you'll usually see on encoders, a on an endless encoder, you'll see no no marking indicator, versus something like a potentiometer that has stops on it. And then, you know, that means something that means something here. Those those indicators usually aren't useful. All right. So let's see, let's get back to questions. I thought I saw another one. Stuart Riggs says rotary encoders on Arduino was a process for me. Yeah, I it's been a while since I've done them. And I believe that there was a bit of a process for it. But usually there's a library that makes life easier with these things. What else? Oh, let me pop up the discord here so you can follow along. Let me move that piece out of my face there. There we go. Good. All right. Oh, yeah. So Todd bought said that since this is a metal knob, this is a this is a metal knob here. You can do is cap sense hack, which I, we need to look at that. I need to try that out. I'll show it on the show sometime. Todd bought came up with a way to use the metal knob on the metal shaft as a cap sense input so that you can tell if you're touching the knob or not. And that's different from clicking it in the case of a push encoder and it's different from turning it. And I don't know did Todd tell us did you do that with I don't know what board you used. I know that this trinky has cap sense here so you could maybe run a wire from that to a part of the rotary encoder itself. I'm not sure if that's how you did that. How'd you do that? Clever Todd. Excellent. All right, so let's get to the project of the week. Get this thing out of the way. So this is I'd love to introduce our new macro pad. You may have seen us talking about it a bit. Oh, look, and there's one of those those knobs I was talking about. So that's our kind of default soft touch knob that we put on there. So I'm going to show you it in action first and talk about the software then I'll take it apart and put it back together since I wanted to start with this actually working since I know it is right now. So let's start off with what is this thing. So this is an RP 2040 chip on there same as the Pico from Raspberry Pi. It's the Raspberry Pi chip. And this has a set of 12 mechanical key switches. So it has 12 pins on the RP 2040 that are being used directly as digital inputs, which means we're not doing a scan matrix and we're not doing a shift register. It's just individual inputs. And they all have neopixels underneath them so they can be individually addressed to do different color things. And that can be anything from just light them up a color light each key a different color change colors when you press them have the colors change when you adjust the rotary encoder or something else in your software needs to update you. But we also have this really great OLED screen on here and that means that we can do I think it's 128 by 64 so we can do some pretty nice sharp display especially of things like little text labels which I'll show you I'm working on that. And then it has the push encoder on there a little rotary encoder with the clicky button. And that is that is about the shape of things. And so what I'm going to do is plug in first of all I've got a USB C cable here and I happen to have a little right angle connector on it which I like for sending that cable off to the side. This is a cable that I just coiled earlier today I didn't coil it super tight but I coiled it over brass tube heated it up and then chilled it with some upside down air air air duster can canister my old hack for that so it's got it's a long cable and I just wanted to be shorter and coilier so now it is and you can see now this thing's lit up so let me let me give you a top down view of that so you can see a little better. What's going on and let me put me off to the side there there we go. So you can see here when this starts up it gives me a little readout on the screen that says its name macro pad PID by the way my camera setup is giving it a little bit of a flicker to the screen that you don't see in real life so just so you know it's it's not doing this on you all the time it's actually sharp and still. So actually since we just talked about rotary encoder you can see here I've got a little readout on the screen there of my rotary encoder position starts at zero when you start it up and now we can adjust that. I have code in there which I'm not using right now that will adjust the volume and I didn't want to be messing with this computer while I'm while I'm trying to do the show because that that can be a bad thing so actually commented out that as well as the mute so when I press this button it does the mute it also you can see flashes my flashes the brights there so that all the LEDs all those neopixels have a brightness value of point one out of a possible one and when I press this it goes all the way up cranks up to full full one brightness. And then here on the side all I've got is just a little label set of labels basically that's telling me what do these keys do I have them set up as a number pad right now. So if I want to use let's say a different camera I can hit four five and six and those are just sending the HID keyboard command of 1234567890 and then I have star and asterisk just like or star and hashtag or pound just like a phone keypad basically and those are just sending those as if I typed them on my keyboard they do the exact same thing so if I if I put if I just hit one on my let's say four five six on my regular keyboard it's the same as four five six here and the HID commands they'll they can be anything you want if you're just using USB HID keyboard stuff they can be a keystroke they can also be keystroke combinations so you can do control alt delete if you want it to you can you can do copy paste buttons that are actually a group of macros which is why these are called macro pads a lot of the time so sort of a little different than just a number pad which usually has one or maybe two functions it's usually either a 10 key number input with calculator buttons for plus minus divide multiply that's pretty typical a lot of number pads on either built onto your keyboard as a separate device will have a num lock button in the upper left corner that switches the function of some keys to be arrow keys and a few other things like page up page down I think so that's that's usually the number pad the macro pad is more of a it can be anything you want type of thing you could for example potentially code it so that it works in this sort of sideways orientation and you might use something that requires three rows of four keys for however you want to use it maybe it's for gaming if you have chains of commands that you want to send will be doing some projects with with that sort of idea in mind I think I'm going to do a minecraft cheat pad kind of thing for creative mode that that does different types of macros and turbo things and you can also create layers of functionality with this I think Phil B might be working on a macro pad for graphics software shortcuts where you could just turn your knob and go between okay here's my shortcuts in Photoshop when I'm painting in Photoshop here's the shortcuts when I'm doing photo editing here's set of illustrator shortcuts so you can do a lot with that that I think it would be useful to update this little screen here to tell you what those are being used for doctor says they want to use this as a cyberdeck type of thing in a movie absolutely it's definitely well well suited for that let's see the code for this let me let me jump over to Adam and switch switch out actually let's go to where'd that view go I have a convenient view setup for this that one will work really well yeah okay so in here in my text editor this is the code I'm running right now on this and a lot of this is in flux so right now there are a few libraries I'm using to accomplish this which will I think we're we're planning to make some convenience a convenience library for macro pad Catney's working on it right now that will do some of the setup and things for you it won't it won't mean you can't do the same stuff it'll just make some things a little easier to do so mine you can see I'm importing a ton of libraries right now the key one here pardon the pun is keypad so in fact let me jump let me jump to my browser here for a second and I'll show you a few things first of all here's this product there's a couple of versions of it's out of stock right now but you can you can sign up to be notified when it's back in stock there's another version that is the bare bones kit which is just the PCB pre-soldered but you'll have to bring your own switches bring your own key caps and bring your own mounting solutions or you can buy a little extras kit we have that includes the plate that kind of keeps the keys locked in next to each other so they don't wobble which can happen if you don't you don't put that in as well as this beautiful silk screen that Phil bill Phil B did that goes on the back and we'll take a closer look at that in a second when I take this apart if you head to the main guide which just came out yesterday from catney this will go over the basics and how to use it in both circuit python and in Arduino and one of the keys to this is this keypad and matrix scanning in circuit python library that dan halbert wrote this is able to read individual GPIO pins like we're doing here but it can also read a key matrix a scan matrix that's like a diode matrix with columns and rows as well as a shift register set up that uses a shift register to check the different pins and the different keys and so that's what I'm using and I'll show you show you how that works for the basics of it and and the specifics of how I'm using this project so I won't go through this in excruciating detail all of these things here but the main thing here that I want to talk about is the setup for using the keys so I've imported that keypad library I've imported the board library since I've imported those two things I can do this I can set up this list of the different keys that I'm using and I'm picking those in this order of I think one is the upper left corner and 12 is the bottom right corner and you'll you'll notice those pins are not zero indexed these names of these objects these board objects have one indexed which keeps it a little more in tune with the way a number pad or macro pad works or the way people think about it and then I'm creating this keypad object so it's we're calling it keys this could be anything could be called macro pad but the key pad dot keys as then being fed this list of the key pins so these are the pins I'm using so if you wanted to use this on something else let's say you wanted to use it on a QT pie for example or a feather board you would just feed it the list of the the GPIO pins that you're using with buttons or keys attached to them and then we're setting it to say are we going higher low or true or false when we press and is it a pull pull up which we're saying true it's pull up resistor so that again might vary depending on the type of board you're using it with then we do some stuff where I'm setting up some variables for colors I'm setting up my HID both keyboard and consumer control which is stuff like mute and volume up my volume down and then I've got this code that I keep recycling or slightly changing that I did first with I think the launch deck project I built using the trellis M4 and then again with my Pico keyboard that I built and now again what I'm doing here is I have this dictionary that includes 12 items in it and then each of those have their own little set of data that I want which is the color that I want the key to be whether it's going to be a key press or a media control thing in this case they're all key so they all say key there and then what they do when they get pressed so here you can see I've got seven eight nine four five six one two three and then the shift eight which is the star the zero and then shift three which is the hashtag so we have some great guides about how to use HID keyboard commands and lists of what those are and one thing you have to be aware of is that things aren't always named what you expect they're going to be named so there is not a star or an asterisk or pound or a hashtag instead those are named for the shift function of of some of the number keys in this case if you wanted a capital A you would do key code shift comma key code a so that's that's how you're able to string things together which means you can do big huge key commands control all shift delete right arrow all that's possible then I'm setting up the encoder just just the same way I showed before as well as doing the switch on it setting up the neopixels on here and then setting up the display and we'll do more stuff with the display as I as we're going to incorporate some display stuff into the library for the macro pad so I won't go into it now this is just using sort of our our traditional display IO for graphics and then I'm setting up the title here and the text for the read out of the knob and then I'm setting up this little set of variables for where I want to place these little labels this little cheat sheet and then I have this set of labeled data that again is is kind of a dictionary of my what's being displayed where it is on x where it is on y by the way thanks to our good friend Todd bot for helping me come up with a somewhat succinct way of doing that so this this runs through and sets up all of those rather than one at a time setting all those labels which is makes things more efficient thank you Todd and then getting back to the meat of how keypad works this is the sort of key thing event it is event based and event equals the keys event get so this is part of Dan Halbert's keypad library it goes in it just sweeps through and checks either the matrix the shift register or in this case just all of those pins all 12 of those pins and says has anything changed if nothing has changed that means nothing's being pressed then I'm going to go ahead and do all this stuff with the encoder from changing its value on there to changing the brightness so all of that encoder code is happening when no keys are pressed including I'm using the debouncer for checking the switch when that switch falls you can see here right now I'm just printing the word mute let me go ahead and show you my serial output here so you can see it's changing that value as well as printing volume up or volume down I'm just doing those right now instead of having those actually change my volume or my mute but these are the codes these are the commands that I commented out so we're not doing those right now volume increment volume decrement and mute and then the actual reading of the keys is kind of the main event right here again pardon the pun num equals event dot key number so event returns which key number has had something happen and then if that event is it being pressed we do one thing and if that event is it being released we do a different thing so what I'm doing here is keyboard dot press and then going up and checking my little dictionary there to see which thing for the currently pressed key happens so I'll place my cursor here and I'm going to press the bottom right key which as we can see from the legend is the hashtag there so that's a comment that's kind of a safe thing now I can go through and start typing stuff and you'll also notice this has key repeat because we're using the HID key command of press rather than the HID key command of send so send I actually am using that with my mute CC send that sends a one time thing when it gets pressed and doesn't really care if it's been released or not but that means you can't kind of hang on that and spam that button with the press and release it will which is great for things where you do want to have a key repeat happening and delete that out of there I need those then I'm also printing the name of whatever I've done down here in my serial ports you can see not only is the event returning its thing which is this print event so that's kind of what the library the keypad library knows is okay event key number nine was pressed or released which is nice for debugging I won't need those in the end probably don't need these print statements here either but I may end up using that for some stuff on the screen so maybe nice to highlight a character when it is being pressed or just show you a little print out of what you've you've typed in there almost like a ledger and a calculator type of thing and you can also see when I press a key I am changing the pixel to red so here you can see that goes red when it's get pressed and then it goes back to its default color when it's released and that default is taken again from this dictionary key map whichever item in that dictionary it is and then the zero item within that little sublist which is the the color and then I show the pixels that's the the new pixel since they're not set to auto show and then I have a little debounce here that I probably don't even need because I'm printing and and lighting up the pixels which means that there's probably not a not a huge chance of needing it the I believe these are automatically debounced internally in fact let's let's shut this off and see if I'm if I'm right we should be it behaves as as expected let's see this is stuff yep yeah so I don't need that in fact we probably don't need time in here at all unless you decide to start doing doing some other things like counting elapsed milliseconds to do some light show stuff that kind of thing so that was a lot let's see are there questions encoder can be used to set different profiles for different programs and uses as doctor absolutely that's I think a really cool idea it gives you a lot of versatility in fact if you look at the project that I was working on last week using my keypad as a modal MIDI keyboard I don't have a order encoder or screen on there and even have new pixels so everything I do is kind of key combos on start up or or when it's running to send MIDI panic this instead allows you to do you know I in fact I'm gonna I think I'm gonna rewrite that a version of that for this so that I can pick scales and keys from the screen using the encoder the question is does the key repeat is the same delay frequency of the OS settings yes I am 99% sure that that is the case because there's nothing in this code and I don't think there's anything in the the library for HID it is just simply sending the press HID command or message and then the operating system is doing with that what it wants and so your operating system key repeat should be what what we're seeing there so yes same as pressing regular keyboard interestingly in some cases with with regular keyboards particularly older keyboards that might have an LED underneath the caps lock and and maybe the scroll lock and maybe escape those LEDs are actually not driven by the microcontroller inside the keyboard it's actually a message coming back from the computer so if you're ever fooling around with an old keyboard and you're trying to send like a ps2 keyboard and you're trying to get the lights on it to light up they won't until you have either microcontroller your computer on the other end sending a command back telling it to to do the thing which is which is kind of interesting let's see any other questions no okay so let's let's jump over here to the bench and I will pull this apart for you so you can see how it goes together and also take a look at the beautiful parts on here let's see we have yeah we have about 15 minutes so I think we're good on time let's do a bit of a zoom in here set that there where you can see it and some stuff out of the way so first of all the keycaps you're going to pry these off this is one of these little whisk looking egg beater type of keycap pullers those are really nice because they they slip in in a pretty thin space and then you just twist them to grab the corners of the key switch sometimes you can just get your finger up under there it depends on the case that you have so so with these you can get the two outer ones from the sides and then get that middle one so you don't really need that but with a more traditional keyboard that has a top enclosure sometimes you need this sort of thing to get in there now these are i'm using these are cherry mx compatible switches from kale these are called box reds and they are linear key switches these are the ones that come with our starter kit version of this that comes with all the parts so that's what you'll get but you can pop different keycaps in there in order to do that what we'll do is we're actually going to pry up all of these keys because of the way the plate works they've all been pressed into that plate and then into the socket so you just want to be a little careful that you don't bend them so that's all it took there and now you can see we've got our our key switches there these then pop out of here so again you don't want to bend the little legs on them but that's what that will look like when you start uh i don't think i have any other key switches are laying around here uh right now they're all in my studio but the um the plate there isn't isn't strictly necessary if you place that on and press it in there it works it's fairly stable you get it at an angle you can you can start to bump it up uh which is what this plate is about the plate is there to to keep these sort of connected to each other mechanically so they don't move as much but that right there will work just the same as um as not having that in fact let me plug this into some power um so you can see say that but let's uh actually find a cable long enough uh in fact let me go grab a longer woven cable from over here so these are these new whoops i just tried to sabotage my microphone hopefully that's still working uh yeah still working uh so this is the the new uh cable that we one of the new cables that we sell that's a usb-a on one side and usb-c on the other uh and it's nice and long so i'm just going to plug this into power sometimes usb based stuff doesn't really run right when you just plug it into power and not a computer but this should light up at least um yeah actually it's failing just it's getting to a part where usb won't initialize uh because because this is not on a an actual computer but you can see there that light is is blinking there there's like a little um let's see i'm going to reset this with this side button see that that's blinking to tell me there's a problem and the code only gets this far and then it says hey usb hid is busy i can't connect anything um so but yeah all of this will run and in fact all these key switches are doing is shorting those two pins so there's a data pin and a ground pin that are getting shorted to each other so you could you grab a wire and do like this and that's the same as uh as pressing any of those keys so you got your keycaps you got your uh plate here to hold the key switches next to each other we have these socketed kale sockets for the key switches and then we have these underlit neopixels so they're mounted on the reverse side but pointing up through those holes and then we got our little display in our encoder so then this back plate this is just a sort of a case to keep things flat so you can put it on a desk and we got a set of bumpers on there bumpons and these are some uh surface mount threaded bosses that you can screw into with a m3 screw uh so that comes soldered on there these are actually pick and placeable solderable things um and then this is this beautiful uh decorative plate that you will never see unless you mount it backwards like that which you have the option to mount it either way you like uh that phil b did defies your own paths and there you can see there's there's the board so here is the uh rp2040 right there with the little raspberry pi logo on it you might be able to see here's the connector for the display and a little ribbon cable usb c here uh there's a little speaker there uh so we're working on uh catney's working on code in fact to to be able to use that speaker uh with the library with the new uh macro pad library that's coming out and then here's this reset button there's also a stem a qt uh port right there that you'll be able to use to plug in any of our sensors or external things so uh that is the main way you'll connect other stuff to this because it doesn't have uh gpio pins available with a header or anything like that so that is the the one way that you'll connect to sort of the outside world of sensors and devices um oh i think that was hidden sorry that was hidden under a camera view i wasn't paying attention to sorry about that um yeah so that's that's Phil's back plate there which is beautiful uh and then lastly i i don't know if i mentioned this before but the boot button is one in the same with that rotary encoder switch so when you want to put new firmware on this you hold boot you press reset you release reset you release boot and then it'll go into the uh the boot loader drive where you can load on firmware after that uh process once it's booted up once the code is running then this can be used as a general purpose i o switch and uh i think that's it so let's put it back together um and sorry i can't see questions from here very well so if there were questions about this while it's open um i'll let me run over there real quick before i fully assemble this just to see uh doctor says macro pet lets you do everything daft punk style yeah a sound board would be terrific work it harder uh let's see hello from the school of cosplay in vegas says gamer versus taylor we're going to be interest integrating adafruit into our lessons later this year thank you so much for this oh that's great very cool thanks for letting us know i love the sound of that school of cosplay that's fantastic uh uh be beata graff of dal hagan says yeah the pins on those key switches are kind of weak they're very thin they're very weak they're just an extension of the the thin little metal inside the switch so yeah they're super easy to bend you do want to be careful putting those back in in fact let me go um put these back in over here and show you this process so um i think there may be a couple of ways to do this but the way that uh the two ways that i've tried and succeeded with um somewhat equally is just place them all in the switch plate first like this uh and then check very carefully that none of them are bent and straighten them if they are uh this especially if you if you're grabbing a you know handfulish of switches out of a drawer or something like that and make sure those are not bent and then you're just going to very carefully place the whole thing like that and double and triple check from the side that that everyone looks like they're lined up properly uh and then just start squeezing that down and as you do that you just want to keep an eye the other way to do it is to just place one switch in through the plate and then another from the corner and work your way around uh but then they're you're both clicking them through the plate and into um their little uh sockets so i think this is looking pretty good and then really you don't know if there's a bent pin there until you um plug this into your computer and try it that's really hard to see a bent pin in there luckily if you're careful you can unbend them you can pull it out and unbend it in fact this one i did that there's one there's one leg on here that got bent that i had to take it out and straighten it with some needle nose pliers uh so it's definitely possible so let's jump back uh over here for a second and see if we succeeded and uh there's a few ways we'll know one is just uh if the leds change color if they change to red that means that it knows i've pressed them just because that's what my code does so yay that'll work and then i'll double check over here in my serial output and uh and just by typing in usb uh that it's registering seven eight nine four five six one two three star zero and pounds so all that's working uh correct so that's about it that's how it works um let me know if you have any other questions we're just about out of time thanks for uh thanks for stopping in for today for a fun look at this new macro pad and uh now i'm going to get to work on some some projects with it so i've already got kind of a cool camera switcher out of the uh out of the bargain here uh but i'm gonna i'm going to work on porting my uh code over for the uh the midi modal music stuff and and change that a little bit uh i just saw a question come through oh wow i've i've got to scroll down there's a bunch of questions um am i going to go blind from direct exposure in neopixels it's possible these are bright uh the keycaps help a little to diffuse it and where do you order the board for your pico keyboard i did not see it on oshpark oh i might not have shared it on oshpark i thought i had but i will thanks stewart i will check uh oh in fact let me let me bring up discord as i go through these questions um the let's go to the um chrome for a second here stewart's referring to this guide uh let's go pico mechanical keyboard with fritzing so you could upload uh in this i tell you uh i give you the gerber file that you would need or the zip file of gerbers you would need to send it uh to oshpark or uh jlc pcb is the place where i had i had it made it made it both of them um but under ordering pcb's there's the gerber yeah okay i guess i didn't okay i didn't share it on oshpark i thought i had i'll share it on oshpark and put a link there um but you could upload it if you want to and uh let's see can we send you letters and or packages um i don't have a p o box but i've been thinking about getting one doctor so if i do i will um i will post because i'm happy to do viewer mail show off stickers uh what have you so um local beers i don't know but yeah i will i'll be setting something up because i've gotten that question before and that would be loads of fun uh and free stuff right so why not uh oh doctor has a has a nice let me throw the discord back on here doctor has a nice um diy version of the keypad going using three of the one by fours that's excellent all right good well i think that's about it um oh question over on youtube from hendrik putt geiter says hi from south africa have you got anything with lidar and do you ship to south africa i do not know if we ship to south africa i believe we have one lidar um yeah we have this there's a few things calling themselves lidar i think of the slam tech if you're if you're talking about like the uh i think that's the rotating rangefinder type that you put on an autonomous vehicle uh so we do have uh a few lidar things so if you go to ate a fruit and and look for lidar uh you should see it there as far as where we ship boy that's an excellent question i'm trying to think where we have that info um let me check on shipping and returns overseas military shipping options international orders uh we do dhl express worldwide to canada europe yeah we do it says all other international locations so the only question mark i think with that is sometimes if an item is considered to be restricted for certain countries so i don't know um but you could certainly ask in the um either support at ate a fruit dot com email address or go to the forums and ask uh and we should be able to help you out if anyone knows in the chat if anyone's ordered uh items to south africa please let me know um and that's about it i think that's going to do it so thank you everyone uh so much for stopping by to play around with this with me super fun and uh i can't wait to see the kinds of projects people are going to do once they get their own so uh sign up now i think we had about a hundred uh that we shipped uh and we'll be making more so uh stay tuned so you can get your own all right thanks everyone and i will see you next tuesday with a product pick of the week and next thursday with a new john park's workshop bye bye