 Hey, hello, and welcome to the show. It's time for another John Park's Workshop. It's me, John Park, and here I am in my workshop, and we are ready to go. So I know there's been some excitement in the world of streaming behemoth service providers. I think we're out on the Twitch today. I don't know if they're back to business as usual at the moment, but we had some resets of some encoding keys and things like that that happened earlier. So I think we should be streaming on Twitch. Let me know over in the chat. Our chat, by the way, if you're wondering where it's at, it's generally right here on Discord. So if you head to the Adafruit Discord server and you can jump into the live broadcast chat channel, that's where a lot of people are talking about what's happening with the show and more. And then we also have over in YouTube, we've got some chat that I can keep my eye on. Hi, Gary and Dave and Shad K. Shad, for whom this music I was playing makes nervous. Well, I hope you're feeling better now that the music has stopped. Let's see, what else is up? Sounds like my mic is maybe slightly hot. I'm just gonna turn that down a little bit. If I'm peaking at zero, I've noticed, it's right on the edge later when I edit these videos. So thanks for C Grover for keeping an eye on that and hopefully we're down into a little more moderate range. What else? All right, oh, that's interesting. Well, my computer is back up and that could have been what caused it. We'll see if that clears up the buffer problem. Looks like it's running again. Yeah, the mic didn't wanna be lowered. That's what happened. All right, it looks like, yeah, it's streaming, but it's giving some bitrate warnings. How's Twitch? I don't dare launch that. I'm gonna leave that alone. I probably have to log back in anyway. Is anyone watching over on Twitch? Does anyone trust that anymore? It's terrifying to have the source code leaked. All right, I kicked that back into gear and we'll see in a moment when YouTube starts that back up. Thanks for putting up with this, these shenanigans. All right, hopefully that audio is back in sync now. And I'll tell you what, it really does feel like my service provider has swapped the Tuesday and service, Tuesday and Thursday service issues because I used to have much more buffering on Tuesdays. Now it's happening on Thursdays, which is a pain in the neck. Oy. All right, well, I think that's probably good now. I'm hoping we're back in sync and I'm gonna plow ahead. I don't think it'll let me start the recording now, now that we're already up and running. So let's get on with it. Let's go through some stuff. First of all, we've got our job board. If you are looking for work or if you are looking to hire someone, you might wanna go and check out the Adafruit job board. It's at jobs.adafruit.com. That's what it looks like right there. I don't think we have any new positions as of last time, but you might wanna look these over or if you're logged in, you can check out people who are looking to get hired and it's entirely free, you just need to log in and we will never spam you or sell your email or any of that stuff. So these are all vetted. This goes through Phil and Lamor. They make sure that the positions that we're posting are legitimate seeming. So you won't get a flood of spammy stuff. That's our jobs board. And let's pull that off of there. What's next? Let's see. So on Tuesdays, I have my product pick show. And during that show, we generally have a large discount, 50% off in this case on the product pick of the week and the product pick this week was the Pi Ruler. And it's about a 15, 20 minute show where I take a look at the product, do a little bit of a demo, take you on a tour of it. And then I like to go ahead and create a little recap, a little one minute recap. So I'm gonna, getting distracted by the error message coming from YouTube telling me that we are not streaming in a healthy way at the moment. Oh, Durat. But you know what? I'm gonna run that anyway. So here we go. It is the product pick of the week. It is the Pi Ruler. Oh wait, the Pi Ruler. It essentially has a Trinket M0 built right into it to run Arduino or Run Circuit Python and beyond just being a regular Trinket, it actually has four of the pins that are normally not broken out on the Trinket running to these four capacitive touch pads as well as four bonus LEDs. You can see here on these capacitive touch pads we have some suggested uses. This is a way to set up a little special keyboard that's really purpose built for your engineering writing needs. Ohm character, the Omega. We have the Mew there for micro thingies and we have Pi. And then also this Digikey logo here on the end we'll actually type in the URL for Digikey's Circuit Python site and go there. That's the product pick of the week. It is the Pi Ruler. All right, so looks like we've got maybe an out of sync again. I'm just gonna flick that little switch to turn off this. And we should be back in a few moments. I think I'm sending this already but the buffering and all that will take a moment to catch up. And thanks for letting me know over in the chat someone said I just said I'm just gonna and then went to nothing. So Lars has eye of the time crystal. Yeah, choppy but in sync. I'll take it. All right, so next up let's see. What I wanna do is jump into the Circuit Python Parsec. You know what? What I'm gonna do before I do that is I'm gonna see if I can start my screen recording of this session in case we need to go to that to rebroadcast. So bear with me. I'm just gonna set up a capture and turn on the record to disk. See if it likes that. See Grover said the closed captioning wasn't delayed during the out of sync periods. Oy. All right, and good. Okay, so at least I'm recording now. Hopefully an in sync version is going to the computer here so I can rebroadcast either take over this full archive stream later or at least just this Circuit Python Parsec because that is what is coming up next. All right, let's get this set up here. Good. What I wanted to show for the Circuit Python Parsec today is how you can ask a Circuit Python microcontroller to tell you what its CPU temperature is. You'll notice some boards come with built-in sensors on the board for things like ambient or contact temperature, but most of the CPUs that we use actually have their own internal measurement for temperature so that you can do things like avoid overheating. So here's how we set it up. If you look here in my console, what I'm gonna do is I'm gonna type directly from the REPL to the board and I'm gonna import microcontroller. Now, if I just type in micro and hit tab, I'll get some tab completion. If I hit dot and hit tab, you'll see there are a few things that I can address here. I'm gonna address the CPU. I'll hit tab again and now it tells me I can ask for things like the frequency, the temperature, UID voltage. So I'm gonna say temperature and that's gonna return to me. It's 30.7184. That's really precise, degrees Celsius. And now what I've done is I've actually set up some code that will every couple of seconds read the CPU temperature and print it out for me and also do the conversion to Fahrenheit. So the way this works in code you can see here is that I'm importing time so we can pause microcontroller. I'm also grabbing OS just so at the beginning there it tells me the name of the board. Then I print os.uname.machine, that's what prints out the board name and the processor. And then in my main loop, I'm setting this variable called temp underscore Celsius to equal microcontroller.cpu.temperature, that's what asks the microcontroller's CPU to return its temperature. And then I also have this conversion in this variable called temp Fahrenheit which is Celsius times nine divided by five plus 32. And that gives me Fahrenheit. And then I print that with a little bit of formatting so we get this nice read out down at the bottom and then I pause for two seconds. And so that is how you can ask a microcontroller for its CPU temperature using circuit Python. That's your circuit Python Parsec. That's your circuit Python. All right, yeah, one question that I saw in our chat was I wonder if you can warm it with your finger or cool it. I've wondered the same myself. So this has been hanging, if you look at it here, pretty steady at 29.3 to six. Degrees Celsius. So I'm gonna put a finger right on top of the CPU and we'll see if it, yeah, I see it's going up 28.7, 28.56, yeah, I don't know that I'm having much of an impact on that. It's not running very hot so it's probably not giving off a lot of heat that's getting adjusted by the ambient temperature. So you could probably get it to overheat, put it inside of an enclosure but I'm not really impacting it that much. So you'll have more luck with an actual temperature sensor that's not inside the CPU package. All right, so let's move on then to the next thing. So it seems like we're stable now in our connection which is good, not wood. So what I'd like to do is do a little bit of a pick, I'm gonna turn this camera off and on over here, just reset itself, everything is rebelling. I think all my equipment is just slightly old now and is tired, I'll turn that back on before we go to the work bench later. So I wanted to do a game recommendation and a little bit of gameplay for you. I often like to do a gear review or a tool demo but I've been playing this game that came out pretty recently that is relevant to the interests of me and anyone who's into logic puzzles as well as modular synthesis. So this, when I saw this, it kind of combined a bunch of my interests. It's called the signal state and let me go to it over here. Okay, so the game actually does a really nice job of explaining to you if you've never touched this kind of stuff, the basics of how a modular synthesizer works and a lot of the puzzles are built around logic problems and these are really relevant to the way a lot of things inside of synthesis work. I wanted to show this off, so it's reminiscent of software such as VCVrack which is a virtual modular software synth that you've seen me use before and the puzzle in this case, my image is blocking it there but it says circuit breaker out one. So this module has an output called out one receives source one which is this over here receives that signal but it's gonna be increased by five volts and out two receives source one signal with its intensity halved. So if we don't plug anything in right now and I just sort of step through the time, one frame at a time, you can see that at frame, the first frame it had zero volts coming out of source one now it has two volts coming out of it, four, six. So it seems like the voltage coming out and you can see it plotted down here that's actually telling you to help you with the puzzle what's gonna be coming out of source one. So I'll hit stop there. So what I can do now is take a little patch cable and connect the source one to a splitter. So this allows me to get multiple copies of that signal because I'm doing in this case a couple things with it. And this is again something that you face in real modular synthesis is needing to split signals out with something often called a buffered multiple. Right now if I plug the outs from the splitter to the system output, it's gonna fail because I haven't done any of the things they've asked me to. But the thing is we've got a little tray with modules in here and they keep it pretty minimal at first so you don't get overwhelmed. It kind of introduces them with each puzzle at first. And the ones that I care about here, there's one called bias. I'm gonna bring one of those in and it says bias takes an input and shifts it by a constant offset value. If there's no input it outputs the offset value that you dial in here. So that means I can do this first requirement which is I'm going to increase whatever's coming out of here by five volts. So I'll take one copy of that output, bring it into this little bias module and then I'm gonna crank the knob up to five. So that's just adding five volts to whatever's coming in. And then I'm gonna send that output to output one. The other one we care about here is this attenuator. It's actually kind of an attenuverter. It allows us to attenuate sort of like a potentiometer does. We can decrease the voltage that's coming into it before it goes out and we can actually create a inverse version of that by going left with the knob. But in this case we just want half the voltage so we're gonna put this through the attenuator set to 50%. So I'm gonna take a copy of the output, go into the input here. By the way, you can make some more sense of what you're doing with colored patch cables. So I'm gonna use red patch cables for this second side of things just to keep things a little more visually clear. And so now if I step through the solution you'll see that it's happy. First of all, down here at the bottom it's not giving me red, it's giving me the happy yellow line colors. And I am getting a zero voltage on first step which gets five added to it and it also gets divided by two, which is still zero. Next step we can see we're going out to becomes seven by adding five to it. And oh, I screwed up my attenuator. Let's get that back up to 50%. I never actually changed it, did I? Let me hit stop on playback. And you can type in numbers in here too. You don't have to use the dial which is nice when you're trying to be precise with it. Okay, so if we try that again now we're successful on step two because it's giving me the seven for the output one and it's giving me half of two volts or one volt for the next one. And then we can just hit play and it'll run through it and you should be able to hear it's lagging a little bit just because so much is happening on this computer right now it's probably not happy. And you get the little tally of your score at the end which is also kind of fun. My favorite part is just solving the puzzles but you also have some of the gameplay built around the efficiency with which you do it, the length of the cables you use, how many modules you use, how much space you take in your rack. So there's a few different metrics there for the score but kind of the most fun part for me is coming up with solutions using these modules for your puzzle, solving it and then they introduce more modules as you go. And there's also a nice little storyline happening about sort of a post-apocalyptic farm that you are rebuilding one piece of equipment at a time by doing modular synth stuff. So come on, it's called the signal state. There's a demo that you can get for free which has I think 10 levels in it. I bought the full thing which might have been 10 or 20 bucks I think, I don't think it was that much. So I'm not affiliated with them, I'm not getting any kickbacks from them. I just thought it was really cool and wanted to share it. So go check out the signal state and it's on Steam, it might exist elsewhere but I'm playing it via Steam and I'm playing it on a Mac, you can get it on Mac and Windows. And I think some people are having some success playing it on Linux with the sort of Windows gaming Steam layer which I think is called Proton if I'm not mistaken. So go check that out. Let's see how someone's telling me that I've got a spelling mistake in Celsius in my code there for the circuit Python parsec. Whoops, at least I've stopped calling it Centigrade because you can tell my age when I was a kid and we talked about the other temperature system they called it Centigrade a lot of the time and I know now that they actually are different. Yeah, Proton, Proton is the name of that gaming layer. All right, so next thing I wanna do, I'm gonna actually quit that game just to see if it gives me back some precious CPU cycles. That's kind of a miracle that that played, pulling games into the wire cast there is something I've had some issues with before but it worked. Okay, so for a project build today I wanted to show off this cool little five volt ring light that I, excuse me, that we just started carrying in the store and I got the bare one which looks like this that is the front of the light. The front of the light it is a cob or circuit on board meaning the LED elements are essentially soldered directly to the PCB not in their own packages first so it keeps it small, keeps it less expensive. Here's what it looks like on the backside so there's not much there other than a resistor and some pads to solder on for voltage and here's a nice picture of one glowing so these are a cool white so a little bit bluish. I don't know they probably make warm and neutral maybe we'll carry those too this is the one we have right now and this is a 70 millimeter diameter ring let me grab the one I have, I just have one so hopefully I don't blow it up during the show here today and it's got a little bit of a diffusing coating on top as well these I don't know if these also fluoresce they may just to help with some of the the goal of reducing the visible dots so that's one of the goals of these is to try to present it as kind of a cool continuous ring of light and these run off of five volts which is really cool because we've had some in the past that run I think on nine volt these run off of five you can run them right off of USB in fact we sell version that has a USB cable with the on off switch for power directly connected to it so that's super easy plug and play so if you're looking for something to simply add to a costume this is great if you're looking to add a little bit of lighting to a photography rig for example you'll notice this is a great size to fit around the big camera cluster on your, let me get this window out of the way here on your modern phone you get this really big camera cluster so if you wanted to just tack that on there with some blue tack or something and have a light you may, might be able to power it if you're cleverly arranging like the cable for a camera connection on iOS to a USB you might be able to even just power it off of there but the thing is you can plug it right into a USB power pack so you can get lots and lots of power and not mess with your phone the version that I'm gonna use which is this bear one we just need to solder a couple wires onto there and then give it anywhere actually from about 3.3 to 5 volts so that's one of the nice things is that we have some range to work with so let me jump over to the work bench I gotta get this camera working again come on camera, it's not hot today so I'm surprised that it's shutting itself off which is usually an overheating thing unless I've somehow kicked the power cable it's trying to run off a battery but I don't think so let me see here focus that Lars was helping me with focusing earlier actually it's a nice way to figure out if you're in focus or not oh and look at that, my little show logo disappeared for who knows what reason that's bizarre that's still there that has gone away weird things are afoot I can't explain that one it just disappeared on its own well we'll get rid of that little black box so let's jump to the main cam and down shooter here and hey look there's woody so I don't mean for this just to be scary puppet day I promise oh by the way I'm just noticing someone asked in the chat on YouTube the signal source is the name of that game so let's jump over there and I've got my chat up on the iPad here so I should be able to tell if you have any questions or if you're noticing any issues with the stream there so let's get let's test this out first and then I'm gonna show you how to drive it using the prop maker featherwing which is a really good option for something like this since the prop maker featherwing has PWM outputs with I think pretty high current available on three pins meant for doing things like sort of analog LEDs like big one watt and three watt LED packages you can just plug one of these rings or up to three of them into your prop maker and then have a nice way to connect it and do some PWM for dimming pulse width modulation for dimming which is really, really nice so first of all, let me see if this is connected to my little camera switcher let me re-plug that and make sure that it's accepting that signal so I can change views from over here I'm gonna test it over here first one, two, there that'll work and give me an opportunity to focus that in a little closer okay, so first I just wanted to get five volts on this to test it out and I wasn't sure what I was gonna be soldering to the power connectors there so I've just sort of rigged up a goofy little wall wart five volts to one of our little DC power plugs that has an on off switch and then I've plugged without soldering I've just plugged in a couple of jumper cables put a zip tie on there so they don't move around in short and that's my test jig there for that could also use a bench top supply so I'm gonna hold this up a little bit so that we can see the glow when it lights but I need to be able to see it from back here so put the so the negative is marked with a little minus sign and that's about it you gotta pay attention to that and now I will turn on this little power right here and I double checked the voltage was correct so now we can do a little and there you see we get a really nice bright light there super and that's facing away so you can imagine which we'll see in a minute once I get it hooked up properly how bright that is to camera so for running this with the prop maker what I've got is I set up a little feather tripler here it's just what I had handy you could do this with a doubler you could stack some a feather in the feather wing if you have them arranged that way this is a feather RP2040 it's running circuit Python this is the prop maker feather wing and the prop maker feather wing let's see can I get a little closer even that's as close as I can get so the prop maker feather wing has these outs here which are a common anode and then there's a different ground for blue, green, red so I've picked just the blue one but that could be anything right that's just a PWM output that it's PWM this pin as a negative ground pin I believe and this is gonna be a constant source I think of three volts on that we can double check that no I think that's five volts actually designed for these bright LEDs so what I'm gonna do you can see I've actually put a couple of these little clips that go into through-hole holes that allow us to just attach leads when we're testing stuff that was actually we'll do that next we'll kind of show the evolution of how I'm working on this so my, let's grab a little multimeter and double check the direction of our I marked this one black here so I knew it was ground but this is the sort of triple checking that we need to do to make sure we don't burn stuff out so I'm gonna get power to that feather board and run this over here so we'll take a look at the code in a little bit what the code is doing is just sending a pulse width modulation of the duty cycle to this ground pin and stepping it up and then down in its duty cycle so that it lights up sort of dim to bright and bright to dim to off so I'm using this white alligator clip here as a ground so I'll just hook that to this little clip connector and this red will be my power and I can double check on my multimeter here multimeter's pretty slow it's not gonna pick up the PWMing that well but we should see this is five yeah it's just not, it's going too fast for it to tell but it's basically going from five to zero back to five or a little more than five in fact so let's get that out of there now and then I'll clip these to the light so this is, get one tooth of that on there you gotta be careful, you'll short stuff out with these there we go I think I am wiggling, there we go okay so this should get brighter and dimmer brighter and dimmer, excellent I'm not gonna dare to turn them towards camera yet just cause I'll short things and make stuff fall apart if I try that so let's put it together so I'm gonna take the power off of this feather and it's not a bad idea to unplug it from the wall and the board just to really be sure of what you're doing so that's disconnected and now this little ring what I'm gonna do is I'm gonna use a JST cable that we have these little I forget which model of JST these are but they're a locking polarized connector so you can't mess up your positives and negatives the only trick with these is that the wires themselves are not marked you do wanna kinda go and make a mark on them or put on some heat shrink tubing before you use them so you keep everything straight so what I'll do is I'll get a little bit of maybe some red heat shrink so that I can put that on the positive wire and know that I'm connecting apples to apples on there so I'm gonna zoom this out just a little here so go into the box of heat shrink I'll get some of this real skinny stuff right here just cut off a little just like that and now it's just pick one so I'm gonna have that be the positive side and I'll go ahead and heat shrink that on my hot air gun it stays nice and snug on there and then I wanna just trace that that's the that wire on that side just flatten that wire with my fingers as I go till I get to the end here and then if you're being real paranoid you can also use your multimeter to check that before really committing so we'll just trim a little heat shrink off of that side or insulation off that side let's take our multimeter in continuity mode this'll beep when we have continuity and so it should be that to that so you can hear that that's telling me yet that's you've picked the right one I'm keeping an eye on it I'm throwing heat shrink on and there you go you can wing this stuff but at some point I've learned it does end up biting you and you burn something out lose a bunch of time and energy and maybe money now if you're using a if you're if you're going to use these rings for something like a wearable cosplay thing you might want to use some of the nice silicone wire which is really soft and flexy this is the sort of normal PVC covered stuff which is is not as neat for hiding under things so next thing we'll do is I think I'll take my cable and the short end of this and solder that to the prop maker so just has a little tail coming off of it and then I'll put the longer wire on this you can trim that wire if you need to as well so let's take that out from there I'm gonna heat up this soldering iron if I can extract it from away from my iPad uh... let's see I'm using one of these snazzy little pencil irons it works pretty well for this uh... so let that heat up grab a little solder station I've got pretty good ventilation I've got the AC fan blowing on now uh... so I'm gonna remove that a little clippy that had there uh... and these are nice because they actually have a little uh... strain relief so you can come in from the top or the bottom and then through these little mounting hole kinda holes drill holes and uh... then solder to the other side and that gives you a nice bit of strain relief so uh... let's see I think I'll have these coming up from the top so I'm gonna go in like so flip it around and then those will dive into their respective holes so this one says v-plus on it right there so I'm gonna bend that over and into v-plus like that and then I can solder that from the top side there low-volt why is this saying low-volt hey that's no good that's a first anyone see what they say low-volt before it's a good supply that it's plugged into weird these heat up faster that's good so this is a tight fit for this iron tip okay looks like I got it shoo uh... and now other side is gonna go into that one marked blue so I'll pull out the other clip that I had there uh... oh no I didn't saw I missed that was out when I soldered I may need to strip that a little longer I'm gonna actually try to solder that in from the bottom side since we have so much more clearance might have been a better idea to start with I should get some helping hands involved here and I should get some needle nose pliers to get that wire where I need it this is not what I thought was gonna be the challenging part of this demo just trying to get that solder there we go yeah that'll do it refocus now we have lots of room it's much better than the other side there was a little uh... capacitor right next to where I was trying to solder made it a little tricky uh... so this one here take that out for a second I'm gonna fold that over this would also be a little easier if you didn't go for this strain relief option but I think it's a nice one with props to have it routed through that hole sorry I'm sure you can't see that very well so close there we go uh... yeah someone asked if I can check the resistance of that ring resistor I will in one second uh... Lamar mentioned that you could change that resistor out if you wanted to use a different uh... voltage on it go to this cool down again alright so uh... we've got that soldered now to the board uh... I'll probably verify that those connections before we plug it in but let's uh... let's see with this presuming that we can check this resistor with it uh... in circuit sometimes you can with things sometimes you can't see seven ohms yeah six point six ohms it's claiming for what that's worth uh... I don't know if that's accurate or not with it in circuit is it so now what we'll do is connect these to the ring uh... and you might depending on how how uh... you're using this in a proper costume type of setting you could get a little fancier with your wiring such as uh... cutting these at different lengths drop the camera here uh... so that you can come in from the side or something I'll just go right right underneath it like this and uh... hold that still yes while we work uh... these are not uh... so I will go ahead and tend those first make it a little easier and i'll tend these as well and if you're not familiar with that term it just means putting a little solder on something before you solder it to another thing just makes it a little easier to make these connections okay so that's a little solder on those guys and then I can clip my wire to something for a second and I'll tend these and now that means uh... let's see I've got these flipped so the uh... negative you can still see a little bit the minus sign on that one so let's do the positive one first inside here this ground and I think we're good looks like that should be negative that's positive it's red positive alright let's go for it so uh... let me zoom some stuff out a little bit let's see what's getting plugged into what uh... so now our prop maker is ready to go you can also uh... I'm just gonna I'm just pwm'ing this but you can also set up a lot of interesting things here with uh... the I believe there's a microphone on it or an input for one uh... there's accelerometer uh... you can do tap detection with that accelerometer you could add a switch or button so there's a lot of ways you could control this you could use an analog input to make a sort of pwm-based dimmer so now I've got this I'm gonna unplug that soldering iron because I need that spot for uh... for the power so this is my usbc power whoops yes it's time to clean the workbench and I'll go ahead and plug it in let's hope for the best hey it works now you can see we get this nice pulsing dimming effect point that at the camera I believe I'm going to half brightness so the duty cycle I have set to thirty seven thousand or something like that is at sixty five thousand uh... so just to prevent from blinding myself mostly and that'll keep this a little cooler too I think by not working it quite so hard but this is now a really nice little light source that you can do some sort of cool creepy effects with that's why I had woody uh... in the box here uh... because if you're doing let's say some creepy up lighting for him come on how cool is that and you can imagine you can get your lens right right up on there on something if you're trying to take a picture of it you wouldn't want the dimming effect but you can see now I've got this nice ring light doesn't interfere with anything see it changing it's uh... brightness in there oh I can't find it oh that now it's bright enough but I like the fact that this thing is so small so light uh... you can just add it right inside of uh... a proper model lighting situation I guess we can be a little kinder to him and light him from the front a little better uh... so that is one way to get this uh... this little light doing some uh... dimming for you using pwm and circuit python let's bring this over to the rig over here and I can plug it in we can take a look at that code now switch to this view I'm gonna set this in our little down shooter plug that in and then we can take a look at it in action uh... so let's actually go to this this little setup here go to the code so let's uh... open it off of the board actually it's gonna allow us to make adjustments and save it right to the board uh... that's why I started from a simple rainbow example or three-watt LED uh... from the guide on the prop maker but then I've adjusted that uh... let's focus whoo that's bright now it's pointing right at me so uh... let's close that uh... so here's how it works inside of circuit python running on the prop maker feather wing I'm bringing in time pwm i o board uh... pin definitions and digital i o so digital i o is just enabling the uh... power pin so it's just setting that pin high it's pin ten uh... and that's the one that the positive side the red side here is plugged into so that means that that pin is always high and then what we're actually pwm in is the uh... ground pin and so the ground pin in this case we're using is that one mark blue but you have that red green and blue and that's how you can mix colors on those three color uh... non addressable non-neopixel type of LEDs so then i set up that pin i called the pin light ring uh... i set up that pin it's actually pin d-13 as a pwm pulse width modulation output uh... and if you're not familiar with pulse width modulation it essentially is a way of sending square waves that are at a low uh... uh... zero uh... or high and you can change how quickly you do that to approximate other voltages so it's just an averaging of these square waves that makes it seem like an analog voltage even though it's not uh... so i'm setting that up in d-13 i have a duty cycle of zero and then i have a frequency of twenty thousand so duty cycle means it's basically off uh... we're setting up a variable here uh... for how many steps of brightness to go with we're going with ten and we're starting that off that duty cycle at zero and we're ending it at this thirty two thousand seven hundred and sixty seven and so that's what takes it uh... all the way up to full brightness opening up that ground uh... then in our main loop all we do is i have this loop that brings it up so it says for the pwm that's just a variable could be i for pwm in the range the start pwm which is zero the end pwm which is thirty two thousand seven hundred sixty seven and then the number of steps it's going to iterate through that many times ten times and increase it each time to get to that maximum uh... i have a little bit of a pause in there so it doesn't happen super quickly i'll take we'll take a look at that in a second what happens if you pull that out and then after it gets the full brightness we drop it back down by doing basically the same thing in reverse we start with that and number thirty two thousand we're gonna end at the zero which is the start number and then we're going to uh... go in increments of subtracting the steps zero minus the steps and that's what takes us from ten back down to zero the light ring duty cycle in both those cases just set to whatever that value is that's increasing or decreasing uh... so if we take a look at uh... just get get rid of the uh... the pause there now it's gonna do it as fast as the microcontroller can so let's hit save uh... and it's blinking really fast it's actually faster than the frame rate of this uh... broadcast so you're just gonna see some some funny business going on uh... you can also make this really slow let's set this up to zero zero point two and now it's just very very it takes a while because it's going through these ten steps to get uh... to full brightness you could make that as slow as or as fast as you want uh... of course is a lot more you can do with it uh... one one nice effect to is to not uh... drop back down but just flick back down to zero so if we set we just comment this code out right here uh... i'll set this back to so now it ramps up to full brightness and then goes to black up to full brightness and back to black uh... so i think that's a nice looking effect as well let's see uh... suggestion on a value it's really bright you can live with it being less bright are you talking about uh... my duty cycle are you talking about the resistors still not sure uh... could you use pwm to reduce the power if i understand the question yes so my end pwm here that's as bright as it's gonna get so it's thirty thousand if i set the state of ten thousand save you're gonna see it will get not quite so bright uh... in fact what i'll do right now is let me comment all of this out and i will just set a duty cycle value so let's go to five thousand save okay that's not enough let's go to ten thousand it was why is it just blinking something's wrong why is that just blinking thirty thousand how about always have to be a uh... real proper number it might know i don't think it does actually you know why it's just flickering what am i doing wrong there i'm not sure what's someone can probably tell me in the in the chat yeah you're talking about resistors on the sp1 so if i said let me see if i if i tell it to get there in one step and i tell it to get to five thousand will we see in fact a dim i don't know what was up okay so that's quite a little quite a bit dimmer uh... especially for for me here in person's a little brighter on that camera i don't know what was up with what i was trying to do is that it's a one thousand so again kind of them it is still yeah that's quite a bit let's see how low we can go yet barely you can maybe see it some illumination what if i take out this there we go now it's steady uh... so let's bring that back up have a five hundred it's a bit brighter double that uh... so you can see you could feed in something like a potentiometer uh... or an encoder and then turn those values that you input into uh... a p w m value that allow you to dimming and that's how a lot of uh... modern lighting works so if you look at like ring lights that use for putting them behind your computer to do zoom calls and stuff uh... i suspect a lot of those are using a very very simple circuit to do it like a five five five timer style circuit to do a pulse width modulation to a big gang of uh... of leds that are rated a ring uh... so that is it that's the that's the uh... ring light in action i just want to give it a little more control than just like the usb version is cool but that's just on or off uh... you can wire it up to your own power source or by introducing the uh... prop maker feather wing in here we had a really great way to do a p w m brightness to it on a nice uh... this can be all uh... running off of a uh... a battery as well if we let me see if i can undo a bunch of times and just get back to where it was uh... almost there we go so now i'll grab a uh... a little lipo battery and plug that into our featherboard and i can now unplug from the uh... usb power and now i've got my nice little portable thing in this this can be doing whatever you want have buttons attached to it knobs dials use some of the built-in accelerometer uh... functions and then you'll have cool prop uh... light ring for whatever nefarious needs you have all right i think that's going to do it so uh... let me know in the chat if you got any thoughts or questions on that uh... otherwise we're going to wrap it up people are thinking stargate yes uh... any other questions thoughts use heated heat insulating adhesive phone between the pcb and a sink oh yes if you want to put a heat sink on it yeah this one is not uh... not even warm from what i was just doing to it maybe just cooled off real quick but let's uh... plug that in doing this i don't feel any warmth on this at all which is great uh... alright so jump back here and uh... hey it looks like we made it seems like we stayed in sync with audio sorry about the rocky beginning uh... maybe that's just the the way it goes uh... he stays with the internet the way it's working for me i don't know uh... so uh... what he says thank you for stopping by sodas lars but he's off camera now and uh... i'm gonna call it right there at two oh four as long one uh... i will see you next week i'll i'll be back on tuesday within the product pic of the week and a workshop show on thursday so thanks everyone and uh... have fun out there by