 It's me JP and this is JP's product pick of the week. Good afternoon to everyone. Thanks for stopping by Hello to everyone over in the discord chat. I see we've got doctor and Stuart Riggs and see Grover and mr Certainly and more and more and hello everyone over in the YouTube land. Hey John. Oh doctor x 17. Hey, that's familiar Yeet Connor mccarter. Hello. Hello and welcome to the show So let's do this shall we The first thing I want to do here on JP's product pick of the week today is point you over at this web page because if you want to get 50% off Go here for this product this URL or QR code will point you right to the product page and if you head there and refresh you will see both This video lives right inside the product page, which is super cool and a little mind-blowing and You can get 50% off during the live stream only on today's product pick and that's going to get you up to 10 of the product No resellers, but we let you get a bunch of them and I think we have a bunch of these in stock So that's a little bit of a hint as to what it is, but let's let's jump back into Present time and now We're gonna have a little journey into the recent past to have Lady Aida tell us all about this week's product pick take it away lady Aida More trinkets. Okay another trinket. This is rotary trinket. Hi. What are you trinket? So rotary trinket as you might imagine is Yeah, USB key with a rotary encoder on it And there's a little RGB LED the RGB LED points down by the way that the encoder itself is not one of the RGB encoders for reasons So it's again usb a it's got a samd 21 on the bottom Crammed all the parts you need we set bun capacitive touchpad on the end rotary encoder with a switch Runs Arduino or circuit pythons. So I'll show that as well So this is I have a hat on it and then you do have to solder in the rotary encoder We might offer a version with the rotary encoder soldered in but I think there's some variations in rotary encoders So we we're not doing it yet You just pick up an encoder and you can see the RGB LED on the bottom here shines down and you can Twist to your heart's content and we program it however you like right now I'm just doing a little demo that does a rainbow swirl because it's very easy to show off There's also a tactile button so you can click so a common thing is like a volume up and down knob or like a Microsoft dial emulator I actually turned this into a very handy thing for me, which is a YouTube play pause and then frame advance or Backtrack so you can go frame by frame through a video online because I was like trying to get some screen captures But whatever you want like a rotary encoders are a lovely user interface Device and so you can just plug it into your USB a port and add it and we program it customize it In Arduino or circuit Python That sounds pretty cool. In fact, let me go grab one right out of my mystery cabinet. I'll be right back Hey, yes, so that's the product pick of the week. It is the 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 you will Sotter a rotary encoder onto there and then usually place a knob of your choice And then you can program this in Arduino or circuit Python to do things on your computer when you change the Position of the rotary encoder or when you click the little rotary encoder button or touch that little Capacitive touch pad. So let's take a look at a demo of it. First of all here it is in all its glory I've got it plugged into a little cable extension just because if I stick that on the back of My computer you're not going to see much you can also plug that into the side of a laptop USB port you can plug that into any USB hub and As you can see here as I change that knob I'm going through some color changes on the neopixel. That's down-facing there. So it's kind of bouncing off of my workbench top and What I have this programmed right now to do is I love the suggestion that lady Ada made which is how about this thing acts as a Controller for YouTube so Frame advance in YouTube is super helpful here. You can see I've got a little Ruiz brothers video on pause and with my rotary encoder now I can adjust that Frame forward frame advance one frame at a time which is normally done with the period and comma keys But that's a pain in the neck and no fun. This is fun and not a pain in the neck Plus you'll see we get little feedback on the color there. Also. I've programmed this to Turn on closed captioning when I click the little button. So you can see there's laughter little turtle laughter there And I've also set the cap touch slider as a play pause So I can Hold pause let go to keep playing or tap it to stop it all together So that's a really cool use for this this sends USB HID commands you can program it to do almost anything you want you could send USB Midi commands if you wanted to you could do something Like type in words with every twist of the knob type a new word There's a lot that you can do with USB HID you can like I said you can code this in Arduino or circuit Python to do that I've coded this in circuit Python. So let's have a look at what that code looks like To do what we're doing here. So let me bring up Adam and Let's go through this code. So here you can see I am importing some libraries including time so that I can do some Pauses if I need to for debouncing that sort of thing importing the board library. So I get the pin outs the the pin Definitions for this board Rotary IO. That's a key one there That's what actually solves for the encoder positions touch IO, and that's how we use the capacitive touch Digital IO is how we're using that click button and then since I'm using USB HID I import that as well as The keyboard and keyboard layout parts of that library if you're using this as something like a volume control You'll use the you the consumer code commands Which I previously had this set up and that's still commented out in here and then going through this what I'm doing is I'm setting up the Inputs for that button so setting that button up as a switch and you can see it's the board dot switch Pin that we're using really easy is setting this up as an encoder I have this variable called encoder to create this object that uses Rotary IO Incremental encoder, and then the two pins are board rot a and board rot B So couldn't get any easier than that then we set up the touch on the board touch pin And then we have some state saving for what the encoder and the button are doing so we can do a sort of edge detection Then I'm setting up the neopixel. So again, there's this one neopixel That is on the bottom of the board Let me bring that up there. You might might be able to see that there facing down Down at the at the desk there is a tiny little neopixel And so we set that up on the board neopixel pin, and I'm using full brightness just because I'm Blasting that right off the desk there so you can see it easily Then the keyboard setup here you can see I'm setting up keyboard as a USB HID device and keyboard layout I'm using the u.s. Layout and this if I were using something like volume up down and pausing of music Then I would use these consumer controls, but I'm not setting it up in this case I wanted to use hue which is a nice way to sweep around the hue color wheel So I've got this hue saturation value to RGB function that converts hue numbers into RGB It's just a little easier when you're changing one parameter to change the hue parameter a single parameter Initially set that up at a particular color. It's kind of a bluish color and then I turn on that pixel And then this is what's happening during the bulk of the Program so first we check to see what's the encoder position and is that different from the previous So that's using the state here to see if that's changed And then if it has changed then we'll check to see if that's increasing or decreasing and if that value is Increasing then I'm going to type in that period key You can see it actually happening right here in my atom session as I turn to the right It's typing a bunch of periods. Let's see if I can undo that And then if I turn to the left down at the bottom, you'll see it's typing in the commas And this is one of those perils of doing USB HID development the next thing we do after we send that is we adjust the color of that pixel and Then show the pixel so that updates with each click The opposite is the case for the counterclockwise turn there if it's less than zero then We're going to send that comma which is the rewind or frame frame back inside of YouTube And you can see that would be volume decrement if I were using consumer control for volume and Then here's what's happening when I click the button if the button value Changes then we've pressed it and if it releases then we send this key code C Which is what turns on closed captioning inside of YouTube and a similar thing for touch value if I've touched it Then we just hold and then when I release we send that space bar so that way you don't have to it's a sort of a type of debouncing that we're using there So fairly straightforward for development. I wanted to show here on the web page for the product This is the product. It's 4 9 6 4 product ID if I refresh this you'll see that right now. That's 50% off We had a bunch of these in stock at the top of the show So I don't think we'll run out, but if we do hey, that's great too. Please buy stuff It helps us keep things moving forward here at Adafruit if you look here. We have a little video demo going on and some images of the encoder Knob a fixed to it. You'll solder that on so there's you can see here. There's actually seven points to solder three are the Ground and encoder Essentially switches for which direction encoders being turned the other side is ground and a pin for the button press and then the side the larger ones on the sides are just the stabilizer Mounce the mechanical mounts on the encoder. In fact, if you look this is what the encoder looks like If you want to get one separately we sell those and they're fairly fairly standard size So you could fit some different encoders on there if you want the Other thing I wanted to point out in the description here Lady to I think wrote this says half USB key half trinket half rotary encoder. It's rotary trinky This is we were inspired by this project from Todd bot if you click on that link here You'll see here was a tweet that our good friend Todd bot sent out that shows using a Qt pie and mounting a rotary encoder directly to the Qt pie doing some clever stuff with pin Selection so that you can use three in a row for the encoder and two in a row for the switch And so that was really cool. That was a neat way to make a circuit Python Rotary encoder, so this was inspired by that and then this one has this added twist of being able to plug right into a USB port and Depending by the way on your USB port some of them are going to be stiffer or looser I found that if you have one that's a little bit a little bit wobbly You can place a little bit of electrical tape on the bottom there and that will grab the Inside of that port a little little more snugly See see this one doesn't really move around too much as I'm using it You can also see by the way every time I touched that cap pin I was I was doing a space bar in my browser, which is Allowing that to frame advance you could also by the way use this as a really cool web page scroller so if you wanted to maybe page down with the tap and Scrub the scroll bar with with the encoder wheel That'd be a pretty neat use for that and Let's see. Oh before I forget We got this great animation. I wanted to run of our Rotary Trinkie bird there and Let's see any questions in the chat. Let me run over to the YouTube and the Discord chats and see if anyone let's see someone got three of these last week when they got their new new key trinkies excellent Aaron York says their friend riskable released a hall effect version of this very cool and Let's see Yeah, electrical tape to the rescue Also, Todd by mention that he's he's done some experimentation with just a shim of a business card in there as well depending on How thick you need it to be that might be just right for you? Thin man asked you using circuit Python or Arduino code. I am using circuit Python You say you're getting memory errors So this is this is an interesting thing to note on These trinkies in particular the libraries you need are baked in so to do the basic stuff that these do in this case Rotary IO touch IO and Neopixel Those are all libraries that got baked into the version of circuit Python that you'll put on this board So you don't need to add extra libraries. You may run out of space is really small So you may run a space if you try to go and add those libraries. You actually don't need them And I believe if you go to the download page. In fact, let's let's check this out if we head over to circuit Python org Go to downloads and go to rotary Trinkie Click on that. You will see I believe there is The description here so where it says oh, I'm not showing that to you. Sorry about that. Let me pop that chrome up That's helpful, right? If you look at this so I went to circuit Python org typed in the search rotary Trinkie clicked on that and then here's where at the top right here Here's where you would normally just go straight ahead to download the uf2 file to put that on if you look here built in modules Available. These are libraries that you may find you need for the code you want to run That you don't need to actually Add to your library folder. So in this case pixel buff board digital IO microcontroller Neopixel write NVM OS random rotary IO struct supervisor time USB HID and USB MIDI those are all baked right in there So those are really likely things that you're going to use so in your code you'll see here At the top of this We're doing an import of all those libraries None of those had to be added to the lib folder in circuit Python because they're baked into that particular Cut of the OS so circuit Python For the Neo Trinkie has all this stuff built in if you looked at let's go back to Chrome here if we go back. Let's let's type in Trinkie if you look at the Neo key Trinkie that we looked at last time here if you check out oh We don't have we don't have that one in release yet. Let's find a different one. How about This one. Okay, so the the Neo Trinkie not the Neo key Trinkie this one You'll see does not have rotary IO built in it has a bunch of Libraries but among them is not rotary IO because this one is not meant for a rotary encoder So that's a little tip for you if you're running out of memory on a memory constrained circuit Python board It may be because you're adding libraries that you don't need to don't need to add And I was doing this too. This is how I ran into this just like a couple weeks ago I said hey, why can't I fit us bh id on here and cat me? I think said oh you don't need that That's actually baked into the OS Let's see other questions Dr. Says why am I copying the code by hand from YouTube? I'm sure this is available somewhere Yeah, we're I don't think we have a learn guide up for this But when we do we will put that code up there So so we'll have some code examples including the one that I showed here doing the YouTube control. How about that? So let's Connor McArthur says bundle fly from the factory. Yeah, so if you grab the bundle the project bundle for one of these projects it Should not add on extra libraries that you don't need because it knows which board You're grabbing that for I think so Test that let me know if that's not the case Yeah, Todd asks is your code published somewhere yet it is not So if you were feverishly copying that from the YouTube, which I hope you're not there it is And like I said, this will go up into a learn guide And by the way, if you're wondering for me when I got this board and started using it I went to the circuit python essentials page. It's one of my favorites. So if you go to learn Dot a to fruit comm I just type s e s s that goes to circuit python essentials and then in here I'll look for something like Rotary IO and Steal the code from there Let's see. Does it exist on this one? Well, maybe it doesn't on this one. Okay, then I may have just typed in Rotary Rotary and looked for okay rotary encoder in circuit python. This one has its own guide So I just do a little bit of searching around and find the code that we can cut and paste from Alright any other questions? So you're ever since easier to copy that from YouTube if you already have the really tricky in hand running the code Yeah, then you can pause and you can scroll Bit of a paradox Okay So I think that wraps it up there it is again this beautiful Rotary Trinky Doing its thing thankfully it's not doing anything bad to my broadcast software because I I don't think I have period and comma mapped to anything So I think that's gonna do it. Let's Wrap this up. So that's the product pick of the week. 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 touch pad And that's gonna do it. I'm gonna go ahead and set that on my ever more crowded Board of Goose good good new products Thank you so much. Thanks Jim Hendrickson Freighted for industries. I'm John Park. This has been JP's product pick of the week Don't forget to head on over While the show is running to get the discount on this and once the show is done that discounts gone So get it in your cart. You have a little bit of a grace period to hit by But that's that's what I recommend is go to that little Page right there while it's still three dollars and 48 cents. What a deal Alright, so freighted for industries on JP. This has been JP's product pick of the week and I will see you next time. Bye everyone