 Welcome to the show, it's me, John Park, and it's time for another episode of John Park's Workshop, which is why we are here in my workshop and we are ready to go. So first of all, thanks to everyone for stopping by. We've got people over in our YouTube chat and our Discord. And if you're over in Twitchland or another streaming service watching the show, wondering where the chat is happening, you can head over to Discord. This is our Discord right here. It's at adafru.it slash discord. You can head to the live broadcast chat channel and hang out. You'll also see we've got a pet photos channel. What else? Help with Circuit Python, help with audio, help with Arduino, a bunch of help. Just general chat, I mentioned that one. So head on over there and get the chatting happening. Let's see, what else is new? We've got our jobs board over here. It says, help wanted. Thanks, Adabot. If you head over to the jobs board, you can check out this position. This is one that was posted just yesterday. And this is someone looking for help with the miniaturization of existing medical technology. No buck. I don't know what that is. This is a, what kind of position is this? Freelance, you can see right there. It's there in Jacksonville Beach, Florida. Hope they're okay. I don't know where that is in regards to the storm. But they're looking for freelance help with hardware design to control LED color and intensity using a phone's USB port for power. Interested in using the Adafruit NeoPixel Ring. And phase two of the project, Python programmer to modify and enhance working code. So if you're looking for a gig and you've got interests, you've got those kind of skills, then go and check it out. That's right here at the Adafruit jobs board. You can just go to jobs.adafruit.com and peruse. It costs nothing, nothing to post, nothing to go and look for jobs there. So that's jobsadafruit.com. Also, things that are going on. I've got my handy dandy logo right there to remind me and to tell you that I've got a show on Tuesdays called JP's product pick of the week. During that show, we have a big discount. We have the show broadcast from within a product page. I've got a Halloween themed one this week. Could be used anytime of the year, but show you the Trinket M0 Neopixel goggle kit. And we had a big, big discount on it during the show. During the show, I usually do some demos, put some things together, take some things apart. And then I like to reduce that down into just a little one minute excerpt. So here it is from this week, check it out. It is the Neopixel goggles kit. It's these Lars. So there you can see we have the goggles. I put a little diffusion material and then we have the two Neopixel rings that are spinning there, doing some cool patterns and picking different colors. And embedded right inside, thanks Lars, right inside of there, you can see we have all of the parts and goodies. The costume goggles and tinted lenses, these are RGB Neopixel rings. Ribbon cable so that you can connect all of the connections you need. A LiPo battery that we use to power it. A little JST battery connector that you'll connect to the underside of the Trinket M0 and you can use Arduino or circuit Python. We also give you a LiPo charger that you can just plug into a USB port. Plug your battery in there and you can charge it in any port that you have. My product pick of the week this week is the Neopixel Trinket M0 LED goggles kit. Bring my mic back, yes. And we sold through those. I think they were sold out by the end of it. So hopefully if you wanted one, you got one at that terrific price. I think they were something like 40% off, 35% off, I think they were at 24 instead of 40. Is that right? Yeah, it was a good price. What else do we have? Oh, this is a good time to do a little bit of circuit Python Parsec prep. So I've got things prepped here. Yeah, there we go. All right, check it out. All right, so for the circuit Python Parsec today, I wanted to show you how you can create a brightness controller for any USB computer or mobile device. So here you can see I've got my phone plugged in, actually have our discord up there. And if I want to adjust the brightness on this, of course you can find ways to do it in software, but I want to use buttons. So here you can see I've got the buttons on a circuit playground express controlling the brightness. And it is done simply through the consumer control command. So there's nothing difficult about it. And in fact, if I took this and plugged it into a computer, it would work exactly the same, no need to change the code. So how is this done? If you look at my code here, you can see I'm importing USB HID and then the consumer control and consumer control code libraries. Then I've set my button A and B to be red that are built right into here. You can use any button given a microcontroller. And then here's what happens in the main loop. If the button up value, that means it's been pressed, then we're going to send consumer control code dot brightness increment. This is a standard. If I press the other button, consumer control code dot brightness decrement. And that's what makes it dimmer or brighter. I've also got a little bit of time delay in there as sort of a cheap version of debounce, but you can use other types of code for that. And so that is how you can create a brightness controller using a Circuit Playground Express inside of Circuit Python. And that is your Circuit Python Parsec. Yes, Circuit Python. I'm always impressed when that works. By the way, I should mention this is an over what they call these OTG on the go cable. Apple calls it their camera kit or whatever. This one is the one that we sell in the Adafruit store. But you can get official Apple ones. You can get third party ones. Especially it takes USB-A socket over to the lightning connector. So that's what makes it work in the phone. If I use it in this cable configuration, that'll plug right into a computer. And then I can control the brightness. But you wouldn't see it. You might see the glow in my face change, but you wouldn't see that happening. So that is our Circuit Python Parsec. Next up, what are we doing here? Let's dive into our project of the week. So you can see down here in my little title of the show, ortho-split keyboard or ortho-linear split keyboard. And this probably could use a little bit of explanation. Let me go over to a web browser here. And I will see if I can open up a URL in this one. This one's a funny version of a web browser that I made a Chrome app out of. I can't remember how to get to an actual open a window. How do I do it? Do I not know how to do it? I don't think I know how to do it. I can't type in a URL. Help. Copy URL, app info. Yeah, this thing doesn't want to. All right, sorry. I usually have a normal Chrome browser as well. Let me just bring one in real quick. Let's do a screen capture of a Google Chrome window. New screen capture. All right, we have to wait for a moment while it checks out what exists for screen captures. OK, that's something. A black hole. I'll share that with you as I bring that up. All right, configure. Let's change that to a window, not a monitor. There we are. Google Chrome. New tab. Here we go. All right, let me just move that over to the side. OK, nice and easy. So if you look at Prionic Keyboard, this is one particular OrthoLinear layout. This OLKB, OrthoLinear Keyboard site, let's see. Here you can see, here's an example of one. Oh, that's a tiny one. So that's a, here we go, Prionic Matias. This one doesn't have any keycaps on it. OrthoLinear in the keyboard world refers to a non-staggered grid. So a grid grid. If you consider a regular keyboard, this is my one that's the battery is starting to blow it on. I need to get rid of it before I burn up in a fire. This has a staggered layout, which is essentially a holdover from mechanical typewriters where the linkages would get in each other's way if the keys weren't staggered. So as far as I know, that's the actual real story, nothing to do with what's easier to type on. We've gotten used to it, it's what we use, but some people have said, hey, I want to challenge that and come up with these gridded, non-staggered or OrthoLinear keyboard types. There's a type called a Plunk, PLANCK, or Plank, which is super tiny, does not have a top row. So it's just four rows, super, super tiny. So you use modifiers, just like we use Shift to turn the one into an exclamation point. Here you use additional modifiers to go between different layers of keyboard, and therefore maybe the Q is your one and your top rows is numbers. So it's a little more to learn at the beginning, less of it is spelled out for you and right there, but once you memorize it, some people like this better. I don't have one, I haven't have one, I decided to build one. I thought it'd be fun to try to build this type of keyboard using our TCA8418 Key Matrix Breakout, which is on StemAQT. Let me go back to my browser that scared me off earlier, this one, and let's look that up, TCA8418. This is a breakout that connects to your microcontroller over StemAQT, but then can connect up to, I think it's 10 columns and eight rows of keyboards. So on these types of breakouts, rather than having one input pin per button, you tend to use a diode matrix where you have columns and rows and we scan across very quickly to check each column and each row, next column each row, next column each row, happen so fast that to us it feels like we've just got direct connection to that many GPIO pins, even though we don't. That's pretty much how most keyboards work. So with this one you can do eight columns, or rather 10 columns and eight rows. This is the chip right there. In fact, I'll go to a little overhead view. Let's put that, pick that there. And let me lower this down here and focus on it. So this, let me get something to point with here. There you go. So here you can see we have these pins called column zero, one, two, three, four, five, six, seven, eight, nine. And then we have rows zero, one, two, three, four, five, six, seven. If we provide this a power ground data and clock over I squared C, then all we have to do is connect up columns and rows to our keyboard matrix. Now this five columns, or rather six column, five row PCB is set up pretty much exactly the way we need to run into that controller. So here you can see this is the front side of it. And we put our key switches down into here. If you flip this over, what you'll see is that the pin out for each of these columns. I lost my pointer. Why did I do that? There it is, is, oh, hold on. I'm being told my audio went out. If the audio is back in, you know what? I'll close, I'll get rid of this shot here. All right. So I'll give that a second to settle out. Let me just check the chat. Yeah, Johnny, Todd, Dave Odessa, sorry about that. Thanks for pointing that out. Let's see if that comes back into sync. We're good. All right, thank you. Thank you everyone for pointing that out. So here you can see this is a column pin here and this is a row pin here. And so if I connect up all three, four, five, six of these columns and all one, two, three, four, five of these row pins, flip that back over to the first six columns and five row pins on here, then we can read this right over I squared C. So all of the checking of the matrix is done right on the chip and it just sends this sort of nice buffer of, hey, what keys have been pressed? And it happens fast enough that you can use it as a regular keyboard. So this connected to a microcontroller, I decided to go with one of these little dudes right here, a little QT Pi RP2040. But the thing is this is really only half of a keyboard. If you look at this layout here, it is exactly half of that prionic layout, which is a 60 key layout, sometimes 59 if you use a double wide space bar. But if we set two of these together, we have physically got the keyboard we need. Problem is there's not a good way to read that arrangement with this because it wants up to 10 columns and up to six rows and there's no way on here to tell one of, give up one of your columns and make it a row or anything like that. So what I wanted to try out was, hey, what if we just, these are pretty inexpensive and simple and they run over I squared C. What if I just run two of these PCBs and two of these TCA8418 keyboard drivers to one QT Pi? Well, normally that's really straightforward because we have a lot of chips that we use, that we break out, have multiple possible I squared C addresses that you can use. So if you look on the back of a lot of our sensors, you'll find some jumpers, we can say, okay, the default is the OX30 and I also want to set one jumper so that I have a second one that's running on a different address OX31 or something like that. This one doesn't do that. So we still have an option which is, there are two separate I squared C buses on this RP2040 chip and broken out on the QT Pi RP2040. So the first one, let me zoom in, is right here on the Stemacutee port or one of them, one of the two. Another different I squared C bus is this SDA SCL pin. These are not linked to the same thing. You might think they are because a lot of times if you see a pin named one place and a pin named the same another place, they're just sort of duplicates of each other like ground or something like that. Not in this case. These are actually two separate I squared C buses. So obviously we only have one Stemacutee port here but we can use a little adapter to connect to the second one or just go directly to these pins. The physical connection doesn't matter too much but the fact is in software, we can instantiate two of these things and just say, hey, they're on separate buses and it actually works really well. So let me take you first, before we look at software, let me take you over to the work bench to take a look at what I've put together. And oh, hey, I forgot one piece of business just because I'm out of the habit of it. So sorry, before we jump over there, guess what? That's right, coupon code time. I forgot, we have a new coupon code. Did I? Yeah, there it is, Splits. So Splits is the coupon code which will get you 10% off in the Adafruit store today up until midnight tonight. So load your card up with stuff. It won't work for software for subscriptions or gift certificates. Always the hardest sentence. But if you want stuff, actual things, then type this in and you'll get 10% off up until midnight tonight. I'll remind you again towards the end of the show. I'm sorry about that. I forgot that I'm out of the habit. Okay, so now getting back to our keyboard here. I'm gonna jump over to the work bench and we'll have a look at assembling a pair of these PCBs so that we can build our own split or not split ortho linear keyboard. So if you look here in my box of project goodies, these are, by the way, designed to snap apart if you need to. So let's say you just needed a four by four. It's essentially a perforated, scored PCB. So you can snap off this little top and bottom holder, snap and you can actually even save those. I might have, here's an example. You can snap that off and then depending on how you've snapped it off, you may need to reroute a broken trace because normally this connects this way. Mechanically, but this is just as usable as this. In this case, however, I wanna use it all and these are designed to have perfect spacing if you put them together. So this maintains standard key spacing. You can tell, you can just look at it there. So put two of those together. We also have some mounting holes both here on the edges as well as pretty much any of, other than where they're connected, any of these meeting points of four corners of the key socket areas, those you can put an M3 screw through. I like to use nylon one so we don't accidentally short anything but it's pretty good space there so you might not even need to. And then we can connect that to some sort of a case, like a 3D printed case, laser cut case, commercially available case, CNC'd case, whatever you want, plank of wood and keep that stable but that spacing is perfect. So works well. The other thing you can do, however, is create what's called a split ortho linear keyboard which means essentially build two cases and set these next to each other which you can use to give yourself an ergonomic layout. Let's say you wanna have this type of kinesis layout where they're on an angle mounted inward. You can have that type of keyboard, you can have them at a little angle here, you can put different little kickstands on them or just have them kind of comfortably wherever you wanna move your hands if you get tired of holding one spacing all the time. Let's say you've got wide shoulders, you want a really wide keyboard, this will work too so you can set them wherever you want. So to put that together, sorry, get a little zoom focus there, what we'll need to do is connect up one of the, I got another one in a bag here, connect up one of these TCA84810s to the columns and row pins on one side, connect another to a second one and then the connection from this far right one is just gonna be a single stem of QT cable going to the QT pie. If you look at how split ortho linear keyboards or any kind of split keyboard is done, there's a wire of some kind, often it's something like I squared C or serial that's saying, hey, the things that are being done over here, we need to tell the microcontroller that has USB going into the computer about it. You usually don't wanna deal with like two separate USB host keyboards, that's just complicated. So instead, we need a neat simple way to send the key press and release info from one side over to another. By the way, for this project, I'm not using the LED, Neopixel LEDs here that are built under each one. You could, you would just need to add essentially your data pin. I think you could take the power and ground off of the I squared C, but you would need your data pin coming over. So enough talk about that, let's see what it looks like when we put it together. So I've got actually a couple phases of this that you can see between the two halves. And I've already put key caps on here because it sure makes coding it a lot easier if you can actually look at a key and know what it is. So this is my sort of prototype side, the first one. I had built this before to prototype with this and I left, I soldered header pins on so that it's easy to just plug DuPont connector cables in. And these, you can see these are the matrix row pins in blue, these are the matrix column pins in yellow. And there are pins here that I'm not using which are all of the ground power and data for NeoPixel. So that's what this is ground pins down here. This is input of NeoPixel data. This is output of NeoPixel data. And so normally those are, it's all strung together. So you don't need to have more than one connection to an in and it'll just run all the way through. If you were using two of these together you could potentially run the out from one to the in from another if you had a reason to want a single NeoPixel object but you can also just run two separate pins to two separate NeoPixel strips which is what this amounts to a 30 pin or a 30 LED NeoPixel strip. Sorry, get that, focus a little sharper, there we go. So what that's running to over here is my TCA8418 where I have in this case again for prototyping soldered a couple of socket headers. I did them in colors so that I could see a little more clearly. I should have matched blue to blue, that would have been smart. But I've got just a reminder myself really that two of the row pins are up here. It's easy to forget and think, oh yeah, columns are up top and rows are on the bottom. And then I have the, let me actually flip this over. This is one of the nice things about this board here is we've got the STEMAQT cable on either side. So that's a little clearer so you can see keys, columns and rows, all that's interpreted and then sent over I squared C to my QDPI. Now, as I mentioned, since I need to have two I squared C buses, I have my second TCA8418 running to a little breakout. This is a little breakout that Sparkfund makes, we sell them. And it just gives you two I squared C, STEMAQT slash quick ports, these little JST ports, that are going over the same, so this is just a sort of passive splitter, same pins that are 0.1 spacing to put on your breadboard or PCB or a Permaproto. And then you can see them running ground, power, data and clock. I got those obscured a little, you can see there. And then those are running to ground, power, data and clock on the QDPI. Now this right now is on a breadboard, make life easy for me. Ultimately, I'll tighten all that up so that this is a port that's maybe soldered onto a little Permaproto next to this guy and they're both living in harmony. But again, nice thing is I can just plug in and this is one of these cool extra long, 400 millimeter or something like that. I squared C cables, it happens to have a nice sort of vinyl coating on it, it's not just heat shrink, this is a nicer coating on there, insulator bundler. So that keeps things neat. It also means that we can have some separation between our keyboards, it might be too long for my needs but you might want to get them pretty wide apart. So ultimately all of this jazz here should be tucked neatly into one case, obviously not with a giant breadboard here and not with this goofy wiring. This one is a little more like what I'm going for which is I've used some thin silicone stranded wire which I very much wish I had put heat shrink over first so I could kind of bundle them neatly. One of the wires I made a little short for what I wanted to do which was connect, there's two mounting holes on the TC-8418 and I wanted to connect those up to the board but I think what I'm going for is not tucking it into this but I'll make the case a little bit bigger on the top and so the connector will just be up here like this. So we can imagine that'll all be sort of neatly tucked there, dead bug and wiring hidden away and then we can use this ortho linear as a split mode or if you put it on a different type of case and base plate and also sort of a switch plate to stabilize the switches a little bit because these are pull out really easily because they are socketed. So you usually want to have a plate that makes them stay a little better. Get this back in there without bending it. But this will totally work as a regular old prionic ortho linear or as a split this way. And some of the features on this, I have not implemented this in code yet but remember I mentioned the layers that you can use to essentially modify stuff so this top row here becomes function keys. You can do things like lower and that could take all these keys and just turn them into a completely different setup and raise. So those are your layers and this is pretty typical for these types of 60% and smaller keyboards is to use these layer and raise that are kind of like a caps lock I think. I don't think you have to hold them. Maybe you can, I actually haven't used them. I'm not sure how these are set up usually in like QMK or KMK but with those, yeah, it probably makes more sense you would hold it. You can do things like, oh, all my arrow keys to be right here. And then when I let go of that, they're back to being IJKL or whatever layout. Doesn't have to be QWERTY layout like this but that's what I use. When you do things like that, that frees up so you don't have stuff like this. I got four arrow keys on there. That's actually quite a lot of real estate taken up by some keys that you could probably layer your way to. So it's all personal choice, personal decision. I've got this right now I think acting as a caps lock and this is a regular shift but there's no shift over on this side. I've got my enter key kind of low. So there's a whole bunch of learning to do there. I've got a piece of fuzz in there. I gotta get out. So let's plug this in, take a look at how it works and I'll show you how the code is set up. One caveat is that this is always dangerous to use a USB-HID device while you're on a computer trying to do stuff but I forgot to bring a laptop in so I'll connect this up and we'll see what's happening inside of Adam. Also it's nice and kind of compact when you can essentially fold your keyboard in half when you have two halves like that with the split keyboard. Todd noticed the BS key that is a backspace key. They decided not to write a backspace. I should have put delete. There's a DEL even though delete and backspace aren't the same things. You could avoid all the hilarity but we don't want to avoid hilarity so. Let's get this set up here and get that out of the way. Boop, boop. Okay. So here we go. I'm just gonna give this a little focus and over in my coding window let's plug this in first of all. So I'm just gonna plug in a USB, if I could find one USB-C to the QT Pi over here. And so that you should see these do have a power LED. You can see the green light there. So you should see both of these light up just telling you've got power. I can't remember if those have another LED on there that you can also access for activity that would be kind of nice. And if I make a new tab in here, so I'm gonna close that and just come in here and type. There we go. You can see I'm not so fast with this yet. Knot. Knot. But you can see enter, up. Got a tab key. So it's doing a lot of things. Like I said, I haven't put any lower types of functionality, lower and raised functionality. So those are just acting as the command or GUI key, which is control on Windows. And I think this one's caps lock. Oh no, I don't know what that one is. Oh, that's a GUI key that just did things. Yeah, I guess I don't have a caps lock on here right now, do I? See shift working there. So let's open up the code that's running on it. This is where you can make a black hole happen. And okay, so take a look at how this works. So I'm importing the library for the TCA-84-18 and then I'm also setting up HID keyboard and key code. You can see I'm not using consumer control stuff, which was what I used for the demo earlier with brightness, but that gives you your media play buttons and stuff. So you can also import that if you want. You can import keyboard layout, I think if you want to do things like type in macros, like have big strings of text and stuff be launched by a single key, but this isn't really a macro pad so I don't need that stuff. And then here you can see, let me use this keyboard here. What do I want? And I don't have a dash on here right now. I have none at all, I don't have a layer for it, so dash name cutie because it's cutie pie. All right, so now we're connected over serial to it. I don't think I have any print statements left in so you probably won't see much. Alt is Alt, Diamond is Diamond, Command is GUI. I think you're right. I don't think I'm using Diamond as meta, but that was a note from the YouTube chat from Beata Grafda of Dalhagen. I think that's, yeah, I think Diamond is often meta, I forget what I have it as, but we can see right now because in the code, I create a single instance of keyboard named KBD, and that's with the command keyboard USB underscore HID dot devices. And then here's my key map. So this is left and right are just separated here by the first section and the second section here. So first section is called key map left, and this is a dictionary that has dictionary entry numbers. So one, two, three, four, five, six, 11, 12, 13, 14, 15, 16. And this numbering is because the, this is how TCA 8418 reports the key press ID, the unique ID of what button you've pressed over I squared C. Since it can have up to 10 columns, it just gives anywhere from button one to button 11. Is that right? One, two, three, four, five, six, seven, eight, nine, 10. No, one through 10, yeah, one through 10. And then the next row down is 11 through 20, next row down 21 through 30 and so on. So you won't see consecutive numbers when you're only using as I am six columns here. And one thing I wanna do real quick just on that note is I'm gonna print key event. So let's uncheck that there and a resave. And with my cursor down here in my serial prompt, a little disco tool, TO, REPL area, you can see, let's see what else am I printing, printing a bunch of stuff. So the key event, maybe I don't, sorry, I'm gonna search here just for print. So print that, yeah, nice, not printing that. Okay, key event, uh-huh, okay. Is that the whole key event? I guess that is. Let me try this other print statement here. This is the, actually, this nice print statement here came in the example code for this library. So again, I'll click down in here. Ah, nice, okay. So key event, I think I've forgotten a, I think I had a carriage return that I yanked out of there. Sorry about that. But you can see essentially five, six, 11, 12, 13, 14. And so there's a different piece of the key event that says whether we've pressed or released, and then the unique ID. So those are kind of the things that we get with that key event. Oops, close that. Which if you parse that out, it's the whole key event, and then this hex code here says tell me the key number. So I actually don't need that printing out all the time. And what I'm grabbing is this key number, which is just that piece. So we'll come back to that, but going back up here, you can see, so here's my key map. I've used this type of dictionary before, both with my numpad 4000 project, and even going way back to some Neo Trellis launch pad code. And so what I use is this dictionary, and when I press a key, we just check the dictionary to see within the key map left dictionary which number key got pressed. So let's say it was key one, first key. Then I have this little entry, which is the modifier. So an unmodified key is just the key as written. It's just gonna type whatever we've told it to type. So in this case, it's the tick marker, the till day if we have a shift modifier. The second one here is gonna type in a one. This one's gonna type in a two, a three, and so on. But when we're wanting to do things like a modifier, such as the shift key, then the way to tell it to send both shift and some other key that we press that I've created is this first entry here, it's not a zero, it's a one. And so that does a different thing. And so I have those set up for control, for GUI, and for ALT. And then I'll also end up probably doing those for the raise and lower, which just allow us to look at a different dictionary of keys when we use those probably. So that exists both for the left hand and the right hand. So you can see the right hand picks up on, again, it's essentially one through six and one through what, 41 for the columns and rows. And it's just a different set of things. So if we look back here on the left hand side, I was forgetting what's the bottom row, second column, it's GUI. So I have that doing the essentially windows or command on the Mac, Apple. Then I've got my dictionary set up. We have a thing called key maps that just takes both left and right sides. And I also have, these are the variables for the state of shift, control, GUI and ALT. We can use all of them if you have big multi-finger key commands you need to do like control, ALT, delete. Then we set up the two I squared C buses. So this is the reason this all works. If it didn't, we'd be stuck because the chip doesn't have multiple addresses. But by saying I'm gonna create an I squared C bus called I squared C left, and I'm gonna put that on board STEMMA I squared C. So that is the built in STEMMA QT port hardware-wise. So that one's called STEMMA I squared C. And then the other one, the two pins there, that's called just board dot I squared C. So that's what allows you to access both of those. And then I'm setting up the two, instantiating the two breakout boards right here as TCA left and TCA right on their respective buses. If I wanna screw myself up, I could just switch these two, set them on the right and left and suddenly these will be backwards. Then we set up a list of those two so we can check them both when we're checking. Since they have the same layout, we can run this little keypads list that will associate each pin on the board as essentially a hardware digital input with the row or the column. And that's just some fancy stuff that goes on in the keypad library for the TCA to 418. Here's the setup, so I just do that once for the left and once for the right. We set the modes, we enable the interrupts, we set the FIFO so the queue will work and that's what kind of bundles up a bunch of the key presses to send them. Set this interrupt output pin and then the main loop, here's what we do. It looks long, it's not too hairy though. So for the range of the two TCA, so left and right, we'll check one, we'll check the other, find out which one we're looking at and then we find out which key map is associated to it of our two key maps that we set up. If one of the interrupt pins, if the TCA interrupt pin says, hey, I need to talk to you, then the events variable is created which is based on the queue, how many button presses have piled up essentially and then we loop through that queue of that event queue there and say, okay, for the next event, we're gonna find out which key has been pressed so that we're casting that to this key map number is the key event x7f and that's the key number. And then we get the associated modifier, is it a regular key, is it a shift, is it a control and the key code itself and that's from the key map for whichever side we're on. And then here, the key event tells you if it was pressed or released, that's one of the things that the TCA 418 sends in their little message there. So if it's been pressed, here's what I do. I check first, is it a modifier? So if the modifier was one, then I'm gonna change my true, my shift mod variable to true, control mod, GUI mod, alt mods, that's just based on that little dictionary there. If it's unmodified, then we, and I know this is kind of a hairy way to do this. Let me see if I can, I guess I'll just scroll that for you. Am I going off the screen with it? No, you should be able to still see that. So this line here, it's kind of wide, I should probably make that a little more vertical. But this is essentially saying, are we in shift mode? Yes or no, control mode yes or no, GUI mode yes or no, or alt mode yes or no. And if not, then all we're gonna do is keyboard press and key code. So that's the simplest case, that's just any key sitting out here other than the modifiers. Then we check to see if it's a shift modifier. If so, then we're gonna give both the key code shift and the key code. So that's how me holding down, move this up so you can see it. Where are we? Shift, A-S-D, A-S-D, A-S-D. Delete those. Same with control, GUI, and alt. Now, I probably need to do this a different way because I don't really have logic for the, I think I lied before, I don't really think I have it working with control, alt, shift, and a thing. So I'll take a closer look at that so that you can do multiple modifiers. I don't think it'll work the way I have it set up right now. And then when the event is not OX80, then that means we have released the key. So this is the if the key is pressed. This is the else, if the key is released. That's the only two things they can tell us. Then if what I'm releasing was a modifier key, we just flip it to false. So we're essentially changing the logic that we're checking here. So any of those, shift, control, GUI, and alt. Otherwise, if it's not those, or even if it is, we're gonna release the key. So that's what's releasing. Now, I don't think I have key repeat. And I can't remember now if that's just a, yeah, I think I have key repeat turned off on my operating system. I don't think you need to do anything in the code here from remembering correctly. If key repeat is on at the operating system level, then while I hold this, it should just keep pressing D, D, D, D, D. And when I release, it'll stop or it'll just think of it as un-pressed. Then this is just part of the housekeeping. Last bit here is the TCA key interrupt is clear. The RQ is set to true. And then a little bit of a sleep there. So that is how this is set up right now. I've got some ideas of improvements to it. One thing is to use a separate file. It's, you know, you can see I'm not using QMK or one of the established things here because I am not sure how possible it is to use QMK or KMK or any of those. And this weird arrangement of two I squared C based matrix keyboards. Maybe it does. I just actually honestly haven't looked into it. But this was pretty easy to set up. One thing a lot of keyboard configurators have is web pages where you can go set up your layout or a single text file. So this could be abstracted out of here or taken out of here and turned into a nice little text file that's sitting next door. So that's one possible improvement. And the other is just to look into this multiple modifier key thing. And then lastly is making multiple layouts possible using the raise and the lower. And so that might require just having like separate key maps that it can toggle between when you hit raise and lower or hold raise and lower. So that's the progress on that. I hope you liked that. I'm gonna try to button up the code pretty soon and build a simple little case, a little 3D printable case for this so you can make your own. And I'll make a variant that is not the split key, but is instead just a fixed ortho linear there. I don't think I'm gonna mess around with the double wide space bar just because you have to change the key to be in the middle there and that then involves snapping it apart. So I think I'll leave it simple like this. Could even, I think someone mentioned it could be cool to do magnets. So if you wanted to, you could say, okay, I'll use our little four pin magnet connector. And maybe some helper magnets to do that connection if you're not wanting a wire there, that could be kind of a neat option. So that's what I got. Thanks everyone for stopping by. Before I go, I'll mention again that you can get a big discount if you wanna go pick up some of this stuff right here. Well, here it is. This is the, you need a couple of these. This is the DCA8014 controller I'm using and these are the, what do we call these? Five by six. Yeah, I think of them as six by five, but five by six is what I'll search. So you see the Neo-Key ortho snapper parts and then a Qtie Pi RP2040. So it's not bad. This is definitely in the range of custom keyboard parts but you get to customize it as much as you want. It could be a different layout from this. I'm laughing because I just checked the Discord where Yanisku has Jean-Claude Van Damme doing his famous splits between semi-trucks there. So yes, the splits. That'll get you 10% off in the store. So head on over, pick up some stuff, type that in in the coupon code section. That is good until midnight tonight. Who's midnight? I'm never quite clear but I think the East Coast of the United States is midnight. Nothing else you need to do. That'll get you the discount. Thanks everyone for stopping by. Thanks everyone over in our YouTube chat and our Discord chat. I will be back. I think we got a Tim Fome Guy deep dive tomorrow. I'll be back on Tuesday with a product pick of the week, Wednesday. If everything is copacetic in Florida, hopefully Reeves Brothers will have a 3D hangouts if the weather holds and then I'll have, let's say a product pick Tuesday and workshop on Thursday. So Wednesday night, don't forget, we'll have show and tell and ask an engineer. And that is gonna do it. Oh, one last thing. People were mentioning keyboard stuff. This is a particular ortho linear key cap set. You kind of wanna look for these. If you're gonna do ortho linears, you may or may not have success using regular key caps for a regular keyboard. And it's just a matter of things like having, if you wanna label shift key, you're not usually gonna find a one unit sized, one key switch size, shift key, tab, enter, backspace. Some of these tend to be bigger. Blank ones for a space bar. You can use just straight up blanks, totally possible. Some people like to go very hard core. And if you look at things like just our DSA blank key caps, some people will just pick up blank keys or maybe some colors mean one thing, some colors mean another. But the ones I'm using here are ortho linear. They're from Drop and these are the MT3, I think, Profile, Dasher and Dancer. These are the Dancer and these are based on the colors of the Dasher terminals. So that's what that is. That's why it looks so dang cool, at least in my opinion. Love the colors. All right, that's gonna do for today. Thanks everyone for Adafruit Industries. I'm John Park and this has been John Park's Workshop.