Paul McWhorter arduino lesson 21
If what we’re going to do today is a little bit of a follow on from lesson number 20 and lesson number 20, we learned how to hook up and work with an RGB LED and we’re going to follow on that lesson and we’re going to do a Little bit more mixing of the colors, and so if you haven’t already done lesson 20, you probably need to go back and do that one. I don’t want to start over from scratch, because then this lesson would be too long, but this is a follow on from the earlier lesson number 20. So what I need you guys to do is I need you to get your eel egg. Oh super starter, kit. Out has all the components you need for this. What you don’t have one look down in the description: click the link. 35. You get all the components, including the Arduino that you need to play along at home. With this with a series of lessons. Also, I need you to pour yourself a nice big mug of iced coffee. I am out of coffee I’m out of coffee. You know you guys, you know what I do. I make this in the morning a great big thing of it. I drink it throughout the day and when I run out of coffee, I stopped making Arduino lessons. You want more Arduino lessons. Somebody ought to send me a Keurig. Ok, somebody should send me a Keurig, and this is my address.
Let me get out of your way. Palma quarter, box 496, Eldorado, Texas, 7, 6. 936. Send me a Keurig. Send me a lot of those little Starbucks those little Starbucks k cups to go with the Keurig and boom. You will be getting a lot more lessons from me because when I run out of coffee, I stop making lessons we’ll have more lessons tomorrow, but I will go ahead and finish this one and what we are doing is we are learning how to mix colors and You can go to the last lesson and kind of catch up with where we are. This was the code where we left off before and let’s just run this code really quickly to kind of remind you of what we could do in case. You don’t remember so. I’M gon na go ahead and I think I need to move over to this view and then I will pop open my serial monitor and here it is here so it says what color do you want you notice as a tribute to our British listeners. I spilled it as Co. L, oh, you are okay. So what color do you want red and when I type red boom this turns red man? I wish I really wish you could see it better, but this auto this auto color balance is making it where it doesn’t show real well and then the next one is green. Okay, that is great man. It is just so perfect when I look down at it, but because this document camera tries to automatically adjust the exposure, it kind of washes this out, then the other one that we can do is blue and it turns the LED, blue and just in case what Happened did not work blue.
Why am I not getting blue let’s see what is going on here? Red green blue blue looks like that. That really really really really looks right. So why is that not turning blue? What color do you want B, lu d? Let me reset this thing: Yui, okay, resetting it works red, gr, ven, and then I do believe that I had another color in there which was aqua and then, when I type in aqua boom, it goes to aqua red. It turns red green. It turns green and blue. It turns blue okay, it’s working this time, alright. So in this, what I’ve done primarily in this earlier in this earlier work is just kind of primarily red turns the red on green turns the green on blue turns the blue on just so, you can see this is just an RGB LED under here that I Have put a little a little color globe on top of a little color a little ping pong ball on top of alright, so let’s think a little bit about how colors work. You know people talk about primary colors and primary colors are red, green and blue, and if you have red, green and blue, you can mix any of the other colors that you want, but really there’s. Nothing fundamental about red, green and blue it’s, just kind of like they are orthogonal away from each other, so that with those three you can mix any other color that you want, but there’s other primary colors.
So let’s look at this. This would be kind of a picture of what I’m talking about. If you take red and green, you can mix and make yellow. If you could take green and blue, you can mix and make cyan. If you take blue in red, you can mix and get magenta. Okay, but red and green and blue are not the only primary colors. You could also come at it from this angle. You could start with cyan, magenta and yellow. If you mix I an in Genta kit. Together, you get blue if you mix magenta and yellow together. You get red if you mix, yellow and cyan together, you get green and you could just switch along this, this kind of color wheel and there would be an infinite number of primary colors that you could use to mix all the other colors. Now, for our particular case, we have three LEDs that are inside of this RGB LEDs and those three LEDs are fundamentally, I have a red one. I have a green one and I have a blue one, and so what I want to do here is just kind of play around with mixing the colors, but I got to use these as our as my primary colors and then let’s see if we can get Some of these other colors and so let’s see if I can find a nice view here. I think this will be a good view. That’Ll, allow you to see all the different things, so the first thing that we want to do is let’s see if we can mix red and green and get yellow, and so we need to come in here and I’m going to take this this one that I Did earlier like let’s just take this this off one here and let’s do a control C, and then I am going to paste control V and we’re gon na say.
If my color equals yellow, then what we would want is, if it’s yellow. We would want blue to be completely off I’m, going to change these to yellow I’m gon na change these to analogue right. So we can get a little more fidelity, it will be end and then and logged and then and log, and then for the blue. We don’t want any blue at all in yellow, so that’s going to be set to zero and then let’s just try the full turn the full on. So that would be 255. That would be 255, okay and now I’m going to download this, and that looks like it’s going to be successful, open up the serial monitor and then it is going to ask me what color do you want co? Al? Oh, you are for all of our British friends, I want yellow, I will type and then, when I type yellow boom, this came on, and this is not really a very good yellow and you can probably not see that very much at all. But it’s really way too much green. I mean it looks a lot more green than it does red and so I’m going to turn the green down to like a hundred like that I’m going to download that alright try again what color do you want? Yellow, okay – and that is a very, very nice yellow. Let me see if I can. Just you see if you can kind of peek through my fingers, you can see that it’s starting to get to be a very, very close color of yellow all right.
So if we come back over here, we have mixed red and green to get yellow now, let’s do green and blue to get cyan. So we will come back over here and we will go ahead and copy this command, because it’s got the analog rights in it and then we will paste it and now what we want is and so yellow we want cyan and cyan is going to have cyan. Is going to have no red at all, and so the red needs to go to zero and then let’s just start at 255, 255 and then we’ll just see how that works pop open the serial monitor. What color do you want sigh end and then hit enter and boom? That is a really really nice cyan see I try to cover it up, so it won’t auto scale quite as much. That is a really really nice cyan’t. I don’t think that I need to tweak that one at all. I think that that is a pretty darn close cyan. What do we want to do next? We want to do magenta, so I will come in. I will copy this and then I will add it to the code and then I will did I add it: aqua, cyan, yellow off. Let me try and control V. Okay. Now I have to cyan so this second cyan I will change and I will make it mud, Genta and magenta would want to have let’s see here.
Magenta would be no green and it would be red and blue. It would be no green, zero and red I’ll turn all the way up to 55 and then green is zero in blue we’ll. Try this and then we’ll tweak it if it’s necessary right. So then I’ll pop this open. What color do you want? I want magenta magenta, okay, that is a pretty darn good magenta. If I look at that, I think it’s a little too blue and it needs it needs to tone down that blue a little bit. So if I come in here, I’m gon na say about a hundred and now I’m going to try it again because it’s a it’s a little purple, it’s purple ish, but it’s, not really pink so let’s say what color do you want magenta? Oh, that is much much better. That is a very, very nice magenta, a very nice magenta. I wish I could make that okay, you can believe if there was some way, I could show it to you better. I would but there if I cover it up, it shows it a little bit better, and so that is a very nice magenta. Okay, so do you see how you can mix any color that you want, and so red, green and blue are easy, because that’s what the LED is already putting out you can mix them to get cyan, magenta and yellow, and then you can just get any imaginable.
Colors and the way you do it is you don’t just turn them on and off, but you can turn them up and down into three values, and so you can see you’ve got 255 different choices of how strong you want the red to be 255 choices of How strong you want the green to be and 255 choices of how strong you want the blue to be, and actually, if you include zero, that’s really 256, so how many different possible colors? Can you get from this scheme? You can get a total of 16 million different colors just by adjusting these three commands and guys. I hope you will try this. I apologize that what you’re seeing on the camera is not nearly as brilliant is what I am seeing in person here. Try this. Let me know how it works at home: leave some comments down below think about giving us a thumbs up. Think about subscribing to the channel think about sharing this with other people also think about sending me a coffee finger I’m. Just joking about that, of course. Okay, Palma quarter from top tech boy comm.
Paul McWhorter arduino lesson 21 Video
Paul McWhorter arduino lesson 21 news
Posted on Friday August 19, 2016Books You Should Read: Basic Electronics Hackaday … Continue Reading »
Paul McWhorter arduino lesson 21 Social