Arduino Tutorial 20: Understanding RGB LED's

  Рет қаралды 164,836

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер: 863
@jasonchristopher450
@jasonchristopher450 5 жыл бұрын
I have been following your tutorials since 2016, and I have never realized until now that you are the person that sparks my curiosity. You teach me computer programming, mathematics, electronics, and the science of how things work. Looking back, I can see how much I know because of you. Paul, you are the greatest teacher I ever have and for that, I just want to say thank you. And I can't wait for the 9-axis sensor tutorial. :)
@jayjay_yah
@jayjay_yah 4 жыл бұрын
Remember to have the serial monitor set for "No Line Ending "
@shuttlepodone1707
@shuttlepodone1707 4 жыл бұрын
Good reminder! On the web based version of the Arduino Editor this setting is at the top left to the left of the baud rate drop down.
@alexcork6986
@alexcork6986 4 жыл бұрын
wish I had looked at this comment an hour ago!!!!! =-)
@slightlyarrogant
@slightlyarrogant 4 жыл бұрын
I spent like 90 minutes to discover what was wrong; Yes indeed I wish I looked at your comment a bit earlier
@wallaceshackleton1889
@wallaceshackleton1889 4 жыл бұрын
Once bitten, twice shy.
@Yrael55555
@Yrael55555 4 жыл бұрын
fell for this - using VScode as my editor so didn't think to check. Doesn't look like you can change it yet either 🤦‍♂️
@robjameson7965
@robjameson7965 4 жыл бұрын
Most excellent "behavioUr" for the English spelling!
@rolstonholas333
@rolstonholas333 5 жыл бұрын
Thanks for the shout out for the UK viewers, there seems to be quite a few of us. Keep up the good work PW
@FuNkT0iD
@FuNkT0iD 3 жыл бұрын
For anyone who is working through this most excellent tutorial - please make sure you adjust your Serial input to "No line ending" otherwise the conditional statements here won't fire. Aside from that, this is 10/10 awesome! Thank you Paul McWhorter! :)
@thefederalbureauofinvestig496
@thefederalbureauofinvestig496 Жыл бұрын
I have been banging my head for a day trying to get it to work and this did it thanks
@adhyayansonthalia1422
@adhyayansonthalia1422 Жыл бұрын
Thankuuuuuuuuu!!!!
@andrewlambdin8568
@andrewlambdin8568 Жыл бұрын
Much appreciated. This was driving me crazy
@neverythingk3270
@neverythingk3270 Жыл бұрын
how to do it can you tell me please i am banging my mind from long time
@Ricky-kw2in
@Ricky-kw2in Жыл бұрын
I was having so much trouble getting it to work but I had it on new line all the time, thanks for the tip, it finally worked!!
@ryanm5291
@ryanm5291 2 жыл бұрын
I made it to tutorial 20! I'm really good about getting excited about something then quickly losing interest. I'm proud of myself! There is nothing more exciting then starting a fresh new lesson (with my black iced coffee) and pulling something new out of my kit! Never thought in a million years I'd be spending my Saturday nights doing something like this but I've never been happier!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
EXCELLENT! You are almost 1/3 of the way through the class. Then off course, lots of other videos series on this channel, so plenty to keep you buys. I can not think of a more fun way to spend Saturday night, and the great thing is you get up Sunday morning feeling great. Keep up the good work.
@ryanm5291
@ryanm5291 2 жыл бұрын
@@paulmcwhorter exactly on point about feeling great Sunday morning! I’m a recovering alcoholic with 5 years of sobriety so it’s hobbies like this that keep my brain in the right place. Noticed all your playlists so I’ll have to look into what else I can learn from you. Probably need to hit up your Patreon too!
@timbrooker8630
@timbrooker8630 2 жыл бұрын
Ryan, I've tried the RGB LED chapter. I can't get it to work. I know my code is correct. I've also tried switching resistors, RGB LEDs, and rewired my circuit more than a few times. Any suggestions.
@FurkanOz480
@FurkanOz480 Жыл бұрын
@timbrooker8630 maybe i think i had it too u should try to see if the connections are good and olso if u plan to lets say give a certain amount like red 50 do it on a port with the ~ then u can do analogwrite or som and olso try to see if u can light up the individual by instead of puting it on an output but the lead that was to the output to 5v to see if it brightens up or not then u can diagnose and olso maybe your resistor is wrong or not connected properly or maybe u forgot a capital in de code maybe idk
@johnnymnemonic3461
@johnnymnemonic3461 Жыл бұрын
@@FurkanOz480Thank you for help. I have the same problem. Tried all the suggestions, found that the declaration of STRING doesn t change it s color, maybe the syntax is different for the newest version 2.0.3. that i use.
@amazinplays7813
@amazinplays7813 3 жыл бұрын
I have spent two days trying to make this work. My serial monitor wasn’t set to “no line ending” . Now it works!!!
@waitwhat612
@waitwhat612 3 жыл бұрын
Same, but why ?
@martini1094
@martini1094 3 жыл бұрын
@@waitwhat612 you need to set your serial monitor to no line ending
@shorifulhaque5137
@shorifulhaque5137 4 жыл бұрын
I deeply appreciate the 'u' in 'colour.' More than you could ever know. Thanks, Paul.
@jakubkosior
@jakubkosior 10 ай бұрын
A little remark, to people who might have problems with the diode lighting up. In my case I had to change the condition statements (starting with "if") from f.e.: " if (myColour == "red") ", to " if (myColour == "red ") ", because the Arduino IDE had some problems with interpretation of the new line after each question. Mr. McWorther, your channel was recommended to me by a good friend of mine. I really do love and enjoy your Arduino Tutorial. Please never lose your passion to teaching and your spirit. I am looking forward to watching your future videos ^^.
@Buddy-do5yk
@Buddy-do5yk 2 ай бұрын
Hi, thankyou for your suggestion to change the if command to include red . I have just spent quite a considerable time trying to work out why my LED wouldn't light up.
@icuderby5486
@icuderby5486 4 жыл бұрын
"Boom" learned some more. Love the UK shout out with "colour"
@dimpledharamsi7704
@dimpledharamsi7704 2 жыл бұрын
Hello ! I was very curious to know about this 4-legged LED and I played along with it for a while. I went through the color charts and made CYAN, MAGENTA, YELLOW, WHITE followed by the basic RED , GREEN , BLUE colors. Further out of my curiosity I did a little experiment with 3 potentiometers and the RGB LED. It worked well and I made other beautiful colors such as LAVENDER and ORANGE. Thank you so much for teaching me the fundamentals so well. Blessed to be learning from you!
@baconguy777
@baconguy777 2 жыл бұрын
Nice idea I am going to do it
@NatureBoy-kk2cv
@NatureBoy-kk2cv 10 ай бұрын
Love the series Paul. I don't have an Arduino as yet but am following. Thanks for the "U" in colour. We spell it that way in Oz. When I get my Ardi I'll do all of the lessons on it. You have an excellent (most excellent?) incremental teaching style. Thanks so much for your work in doing these.
@peterdr8726
@peterdr8726 2 жыл бұрын
Hi Paul, thanks for the arduino lessons, I've never had a better teacher ! I am a retired electronics engineer , and enjoy the modern arduino applications , thanks to you! Peter, Belgium
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Fantastic!
@MardinBodley
@MardinBodley 4 ай бұрын
Same as Peter
@yamaha893
@yamaha893 Жыл бұрын
you've done me a great favour by spelling colour courectly. great episode!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
No Proublem
@unclecrusty5476
@unclecrusty5476 3 жыл бұрын
Thank you very much for the shout out Paul. I decided to use your parseInt stuff so I could manually set the brightness for my program.
@dukydon
@dukydon 3 жыл бұрын
Hi, I also did this however, my blue coluree is way less bright than red and green given the same brightness argument. I tried both RGB leds, swapped current resistors and also swapped pins at the Arduino to no avail. I can try a lessor current resistor but, should I have too??? Any insight would be appreciated! dhrubes@hotmail.com
@BarryWilcockson
@BarryWilcockson Жыл бұрын
Thanks for including us Australians with the spelling of colour. A great series of tutorials.
@kevindegoede9144
@kevindegoede9144 4 жыл бұрын
I have been following the lessons and BOOM I have a much better understanding of programming. What has helped is the fact that mistakes are made, whether intentional or unintentional, and that is where I have gained the most because so many are similar to what I've done. Thanks for the lively and informative tuition. I am especially looking forward to reading to and from LCDs. I hope that is in the programme.
@danthelinuxman
@danthelinuxman Жыл бұрын
Im British and enjoying you lessons !!
@426F6F
@426F6F Жыл бұрын
Just thought about how to make the RGB LED cycle between ROY-G-BIV! I had problems with it flickering initially, but I realized that it's because I allowed the values to reach zero (off) and then turn back on at full brightness. There's all the colours for you and then some Paul! Thanks for being a great teacher. Without your lessons I probably wouldn't have even thought about how to do this! int red_pin = 9; int green_pin = 10; int blue_pin = 11; int red_val; int green_val; int blue_val; int delayTime = 5; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(red_pin,OUTPUT); pinMode(green_pin,OUTPUT); pinMode(blue_pin,OUTPUT); } void loop() { // put your main code here, to run repeatedly: for (red_val == 255; green_val < 255; green_val += 1) { analogWrite(green_pin,green_val); delay(delayTime); } for (green_val == 255; red_val > 1; red_val -= 1) { analogWrite(red_pin,red_val); delay(delayTime); } for (red_val == 1; blue_val < 255; blue_val += 1) { analogWrite(blue_pin,blue_val); delay(delayTime); } for (blue_val == 255; green_val > 1; green_val -= 1) { analogWrite(green_pin,green_val); delay(delayTime); } for (green_val == 1; red_val < 255; red_val += 1) { analogWrite(red_pin,red_val); delay(delayTime); } for (red_val == 255; blue_val > 1; blue_val -= 1) { analogWrite(blue_pin,blue_val); delay(delayTime); } }
@426F6F
@426F6F Жыл бұрын
I think you could also adjust the max brightness by making it a variable that you adjust with the potentiometer and then making that the initialization and the condition parameters for the for loop, but I'm not sure, going to have to try that in the morning!
@bingosmum1
@bingosmum1 7 ай бұрын
“Colour” for us Aussies too. Thank you so much for all these tutorials. The absolute best and easiest to follow.
@madskillz98258
@madskillz98258 3 жыл бұрын
RGB BOOM! I decided for my project to use three for loops to make the LED cycle through all the possible colors. It's pretty nice to watch.
@TheSailingwoodworker
@TheSailingwoodworker 3 жыл бұрын
I got sloppy on this one and powered a few of the LEDs with digital pins. Some of the colors worked but the ones that needed one to be dimmed did not work right. After putting them all on the analog outputs they worked great. After 20 episodes I'm still here. 48 more to go! These are awesome videos!
@KenJacobson-v8v
@KenJacobson-v8v 27 күн бұрын
Thanks for this lesson; for some reason the RGB LED was lighting up green when I typed blue and lighting up blue when I typed green; I checked all wiring on breadboard and connections made to the Arduino and everything checked out okay. I can only deduce that my RGB LED leads are different than the one you used in this lesson; by switching the connections to the Arduino board for the green and blue outputs everything worked as desired. I removed everything from the breadboard and just left RGB LED - then applied straight 5v through resistor to each leg of the RGB LED and voila my hunch was right the leads for green and blue were switched compared tot he one you used. Great challenge for trouble shooting.
@aynursunagatullin7029
@aynursunagatullin7029 4 жыл бұрын
Mr. McWorther, thank you for another amazing lesson, I did the code as well here Is mine int rPin=12; int gPin=8; int bPin=7; String ledColour; int dt=1000; String error="You didn't write an option, please try again."; String msg="What colour led do you want?"; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(rPin,OUTPUT); pinMode(bPin,OUTPUT); pinMode(gPin,OUTPUT); } void loop() { // put your main code here, to run repeatedly: Serial.println(msg); while(Serial.available()==0){ } ledColour=Serial.readString(); if(ledColour=="Blue"||ledColour=="blue"){ digitalWrite(bPin,HIGH); digitalWrite(gPin,LOW); digitalWrite(rPin,LOW); } if(ledColour=="Green"||ledColour=="green"){ digitalWrite(bPin,LOW); digitalWrite(gPin,HIGH); digitalWrite(rPin,LOW); } if(ledColour=="Red"||ledColour=="red"){ digitalWrite(bPin,LOW); digitalWrite(gPin,LOW); digitalWrite(rPin,HIGH); } if(ledColour=="Off"||ledColour=="off"){ digitalWrite(bPin,LOW); digitalWrite(gPin,LOW); digitalWrite(rPin,LOW); } if(ledColour!="Green"&&ledColour!="green"&&ledColour!="Blue"&&ledColour!="blue"&&ledColour!="Red"&&ledColour!="red"&&ledColour!="Off"&&ledColour!="off"){ Serial.println(error); } delay(dt); }
@allensun
@allensun 4 жыл бұрын
As someone who learned Canadian English, the "colour" spelling was appreciated! Thanks for the tutorial as always.
@tomroberts3851
@tomroberts3851 Жыл бұрын
I did your homework task, then I created three counters and created a light that changes colour constantly, SO COOL!! Thanks so much, I've made it to Tutorial 20 and I'm still LOVING IT!!!
@tomroberts3851
@tomroberts3851 Жыл бұрын
PS. I got massively caught out by using pins 11, 12 and 13 before realising I needed to use pins 9,10 and 11 with PWM. Thanks so much for your great content Paul!
@paulmcwhorter
@paulmcwhorter Жыл бұрын
PWM is your friend!
@jadersoares3659
@jadersoares3659 Жыл бұрын
Mr. Paul McWhorter is the best teacher ever! God bless
@zigzag00
@zigzag00 11 ай бұрын
As a Canadian thank you for using Colour ;)
@reecevansanden
@reecevansanden Жыл бұрын
Really kind of you to give the Brits a nod! We're struggling at the moment with all the division over here - a bit of unity is appreciated.
@johnsathe2429
@johnsathe2429 3 жыл бұрын
I can see "new", I can see "improved", but never "new and improved". Can't be done as it is either new or improved. Not both. These are "most excellent" tutorials. Easy to understand and I'm seeing new things and improving my base. Thanks for these.
@Rorschachcollision
@Rorschachcollision Жыл бұрын
As a Canadian, I appreciate the spelling of "colour". These tutorials are brilliant btw!
@luciusrex
@luciusrex 9 ай бұрын
Manitoba represent!
@eli6156
@eli6156 2 жыл бұрын
I have rewritten this program 5 times. Rebuilt this circuit 10 times. Watched the video 25 times. Only to find out about "No line ending" from the comment section. Thanks to the comment section!!!! And Paul
@Large_Woman
@Large_Woman 3 жыл бұрын
20 lessons in, and "hook a brother up" still makes me grin from ear to ear. ^o^
@et4493
@et4493 Жыл бұрын
The extent Mr. McWhorter goes to teach us is a delight
@vgerst8276
@vgerst8276 Жыл бұрын
Thank you @FuNkTOID for pointing out adjust your Serial input to "No line ending" , Spent 3 days trying to figure it out, as well as buying a new Arduino board. After that, everything was good :))
@patrickmachacek894
@patrickmachacek894 3 жыл бұрын
Paul McWorthers teaching is so intriguing that i started the combination of lights even before he mentioned it!
@CK-sv8fc
@CK-sv8fc 3 жыл бұрын
After doing this tutorial. I made a blinking light with different kinds of colours. it was a long code and its all worth it! I'm very happy!
@thegringobaker
@thegringobaker Жыл бұрын
Whew... this one went WAY better than lesson 19. I paused the video and went and coded the exercise (I did glance back at the code for 19 a couple of times) and it worked! I even added a fourth if which lets people know if they entered an unavailable color.
@gilnasty82
@gilnasty82 2 жыл бұрын
Had issues with this once I started adding the extra colors (the assignment). Realized that pin 8 wasn't an analog pin! Once I switched the pins to 9, 10, and 11, everything worked perfectly!! Hope I'm not spoiling the next lesson for anyone!! I also like adding all "case" versions of the word. Silly since it'll just be me typing in the Serial Monitor, but I guess I'm a little OCD too!! HAHA! Another good lesson Paul!!
@julelippmann5246
@julelippmann5246 Жыл бұрын
Thank you soooooo much for your comment! I could not for the life of me figure out why I could not turn on any colour of the LED. Switching pins finally did the trick!
@legendarystudios8421
@legendarystudios8421 2 жыл бұрын
I took a break from Arduino, but I am really happy that I started doing this again. You are the best.
@tpm369
@tpm369 5 жыл бұрын
Thank You for not editing out your errors. More importantly, Thank You for talking out loud while you troubleshoot them. I usually pick something up that I did not know/think of from what you said out loud!
@JayBee6011
@JayBee6011 2 жыл бұрын
I'm British (from Bristol, England). I appreciate the "Colour" gesture, thank you.
@captinkrazy6968
@captinkrazy6968 2 жыл бұрын
This is my second time following along with these videos but i changed up the last lesson and used the RGB LED and i added purple to the color options.
@slnuygn
@slnuygn Жыл бұрын
I've been following this series and playing along, I am eager to learn more and I'm having so much fun! You're the best teacher ever!
@ellerycadel
@ellerycadel 2 жыл бұрын
Good lesson. I messed up the brackets after the "if" statements which made a mess of the LEDs lighting up but once I figured that out it worked like a charm. Thanks for a great lesson.
@tretty07
@tretty07 4 жыл бұрын
Thanks for the shout out, watching from the UK working my way through this series.
@MrRealCAM
@MrRealCAM Ай бұрын
Paul, I am really loving these tutorials. I got my Arduino kit from college and getting stuck into learning how it works. Furthermore, I really appreciate the way your spelt colour!! Greetings from the UK
@VivekYadav-ds8oz
@VivekYadav-ds8oz 4 жыл бұрын
Quick Tip: If you get tired of switching off all the other LEDs in every if statement, just switch of all the LEDs off at the end or at the beginning, and put a _delay_ statement before doing this so that people may get a chance to view the LED state before!
@ryanm5291
@ryanm5291 2 жыл бұрын
Great tip. Thanks. Always something to learn just in the comments!
@dipanjanghosal1662
@dipanjanghosal1662 2 жыл бұрын
That's a great tip. Thanks man.
@tengoose6861
@tengoose6861 Жыл бұрын
Thanks so much. I was tearing my hair out.
@muhammadrafiqulislamkhan6994
@muhammadrafiqulislamkhan6994 3 жыл бұрын
Paul when you say Hold your breath and let see and then say, Boom. This is such a exciting moment to catch your excitment to see your magic. I am new. Just begin to learn. I become so excited when you do to us in your every new project. Thank you.
@paulmcwhorter
@paulmcwhorter 3 жыл бұрын
Love it!
@owlengineeringermany
@owlengineeringermany Жыл бұрын
For those wondering, I had a common anode in rgb led instead of kathode, so i connected it to 5v pin instead of ground. And if you want to turn on the led you need to write LOW not HIGH
@cub1c698
@cub1c698 4 жыл бұрын
Hello, fellow Briton. I would just like to say well done to everyone for getting this far in the course and keep up the good work Paul.
@pathvalleyrailroad9277
@pathvalleyrailroad9277 3 жыл бұрын
I was failing miserably at getting this to work. I would type in a color and get nothing out, no lights but the message popped back up again. I found the answer in one of the comments below, turned the serial monitor to "no line ending" and it works perfectly. :) Thanks for these videos, I'm learning a lot.
@doverivermedia3937
@doverivermedia3937 2 жыл бұрын
So very nice of you to acknowledge us 'Brits". Superb videos ! Insightful and fun. I'm working my way through them all. Fantastic you're digging deeper with important theory. At 58 (and RR aero-engine mechanical engineer), I didn't know a resistor from an LED. Your teaching method is totally engaging. Kudos to you sir. While I'm tapping, and at the risk of being one of those 'wise guys' SOS is souls not ships. 😄. I'm sure i'm not the only smart ass. Greetings from 🇬🇧 ...
@warriorsstatus
@warriorsstatus Ай бұрын
Hii Sir, I am your 18 years old student from India. Love your Teaching from India.😊😊
@simontopley4771
@simontopley4771 Жыл бұрын
Sorry if it's me not holding my breath, my grandson has been trying for you, but being a wee man, he can't quite hold it long enough, he's ever so sorry. I enjoyed this one, i made a silly fundamental mistake, when I copied and pasted, i copied the silly readstring line, then pasted it on all of the paragraphs, which did create some odd results, i could light red, then it would sort of loop into the test paragraph, and wouldn't do anything, the serial was locked up, i have time stamp visible, which helps no end when i'm debugging. Thanks for the UK heads up. By the way, serial settings, 9600 is most common, even today, if I'm consoling into a telecom shelf, we use 9600, 8 none 1 none, seems standard. Thanks again. Simon
@RavensHammer00
@RavensHammer00 Жыл бұрын
I loved being able to play around and get just the color I thought matched the colors asked for, the values suggested online were way off to my eye!. Thanks for the lesson, Paul!
@tkingstl
@tkingstl 2 жыл бұрын
Great lesson, it puts into perspective the 255 value(s) of color mixing in most programs.
@crewchief2761
@crewchief2761 3 жыл бұрын
Some times want to scroll up and fix things. Great lessons.
@scrappybobbarker5224
@scrappybobbarker5224 3 жыл бұрын
The last couple videos about user interaction were a lot of fun, but this program is just too much fun, in addition to your assignment I think I'll have to add a few dozen more colors. Thanks and God bless!
@vedantalimchandani4100
@vedantalimchandani4100 3 жыл бұрын
I always thought online teaching can never be effective and you could never tune with the teacher. Paul, you made me realize that even online teaching can make bonds between teacher and student.
@flipper556
@flipper556 Жыл бұрын
Hi Paul! GREAT LESSONS, thank you!!! Here in Canada, we also use colour. Color while gaining popularity is, at this point, American only.
@ericsmith7988
@ericsmith7988 4 жыл бұрын
This lesson is basically like the last one I just replaced the 3 separate LEDS with the RGB LED. I do not have a small ball like that, I tried using paper and other items but I see where the RGB LED would have uses. Thank you Paul, when I get a ball like that I will come back to this one make different colors.
@matthewmoore7916
@matthewmoore7916 2 жыл бұрын
I would move to Texas just to take a class with him. I LOVE THIS SERIES!
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Well, I live in Africa now, so you would have to move to Africa.
@matthewmoore7916
@matthewmoore7916 2 жыл бұрын
@@paulmcwhorter I would do that, also that’s really cool!
@lordmesha
@lordmesha 4 жыл бұрын
i had a common cathode but ive figured it out by looking at circuit diagrams online. used what i learned here to make it work!
@Yrael55555
@Yrael55555 4 жыл бұрын
British learner here, appreciate the UK shout out (Canada and NZ do it too tho!), as well as the course in general
@dougrowell7817
@dougrowell7817 4 жыл бұрын
Learning to add your nuggets together. I designed a simple project that dims a blue (oooh special) led using a potentiometer. It then lights a red, yellow or green LED if safe (0-3V), warn (>=3-4V),or red if >4V. If >4V, the system "shuts down", killing the blue LED and lighting the Red. You then need to freduce the voltage and press the reset button to restart. Simple in the real world, but cool for a newbie like me...
@ahopefiend1867
@ahopefiend1867 5 жыл бұрын
paused at 2:03 in search of a ping-pong ball...
@Японскийшагзашагом
@Японскийшагзашагом Жыл бұрын
Thank you very much for an amazing lesson! Had so much fun with the ping-pong ball, and when I turned the light off:"Boom!" It looked great! Changed redPin to ~6. Assignment is completed, but Orange doesn't look really well, although I checked in the internet. Looking forward to the next lessons!
@stevemorgan3597
@stevemorgan3597 4 жыл бұрын
I had a lot of fun creating colours with this one. I used a "while" statement to have the blue and red Led's blink alternatively. Any character sent to serial input turns the blinking off. Thanks for these tutorials.
@subharatnodas4737
@subharatnodas4737 4 жыл бұрын
Hello sir. I don't know if you will see this comment or not, but still I felt like writing tHis. After seeing this video, I did a new thing. I used 3 potentiometers, and used them to control the extent of red, blue and green colours respectively in the RGB led. And boom, I was so happy when it worked out as expected. I could manually control the colours without giving any colour name as input in the serial monitor.
@thisguy5279
@thisguy5279 2 жыл бұрын
You had me going on the red led on the homework. I couldn't trim the red for some reason. Finally figured it out.
@preetamsingh147
@preetamsingh147 4 жыл бұрын
I literally loved playing with analogRead commands in RGB. That was freakishly interesting. Thank you Grand Pa!
@SusanAmberBruce
@SusanAmberBruce 5 жыл бұрын
Using a loop to set integer values for each colour of the RGB LED. here's the code! it uses a loop to ask a question and then uses a function to input the values: int redpin=9; int greenpin=10; int bluepin=11; String setmsg="Would you like to set a colour for RGB LED?"; String redmsg="What value do you want for colour red?"; String greenmsg="What value do you want for colour green?"; String bluemsg="What value do you want for colour blue?"; String answer; int redval; int greenval; int blueval; void setup() { // put your setup code here, to run once: Serial.begin(9600); pinMode(redpin,OUTPUT); pinMode(greenpin,OUTPUT); pinMode(bluepin,OUTPUT); } void loop() { // put your main code here, to run repeatedly: Serial.println(setmsg); while (Serial.available()==0){ } answer=Serial.readString(); if(answer=="yes"){ RGB(); } } void RGB(){ Serial.println(redmsg); while (Serial.available()==0){ } redval=Serial.parseInt(); analogWrite(redpin,redval); Serial.println(greenmsg); while(Serial.available()==0){ } greenval=Serial.parseInt(); analogWrite(greenpin,greenval); Serial.println(bluemsg); while(Serial.available()==0){ } blueval=Serial.parseInt(); analogWrite(bluepin,blueval); }
@charlesmarlin6632
@charlesmarlin6632 5 жыл бұрын
Added Mauve (RGB 197, 140, 157) Color option because this is such a 'Mauvelous' Arduino Video ... Well Done. Having a lot of fun learning from the Tutorials.
@kageshirou
@kageshirou 3 жыл бұрын
I have been learning all your lessons and doing all the homework so far and it is awesome! I'm from Canada so we use "colour" here. Thanks for all the lessons so far.
@magwitch
@magwitch 2 жыл бұрын
Just started watching this series yesterday. I greatly appreciated the "U" in colour! Thanks for the lessons, they've been very helpful for understanding micro-controller code. Cheers from the UK.
@paulmcwhorter
@paulmcwhorter 2 жыл бұрын
Welcome aboard!
@Dhananjay_Pandey
@Dhananjay_Pandey 5 жыл бұрын
Hi Mr. Paul ,❣️You From "The India" Your Videos are really Amazing 😍
@prashantgunjal5566
@prashantgunjal5566 4 жыл бұрын
me too from india
@tellder1
@tellder1 4 жыл бұрын
Age long question "If indian guys teach everything on KZbin, then who teaches indians?" has finaly been answered! It was our best teacher Paul all along!
@rushipadhiyar2615
@rushipadhiyar2615 3 жыл бұрын
@@tellder1 True that
@Anonymous-yy5qr
@Anonymous-yy5qr 3 жыл бұрын
@@tellder1 truuu
@ErlankBru
@ErlankBru 8 ай бұрын
I sit and played with these assignment colours... Loved it! Thanks Paul!
@johnkafer5061
@johnkafer5061 4 жыл бұрын
I'm a 71 yr old ham who studied electronics just enough to get my extra class ticket in the late 90's. Now I'm back for a deeper dive and your series is great....don't apologize for the drawings and math! Just right for me....... 2 questions: In the statement "int potPin=1A", "1A" is considered an integer? Why allowed? In another lesson, I've neglected to create a pinMode statement, but the code compiles and the correct LED lights at approx 1/2 brightness........why would any voltage be allowed through without the pin being spec'd as an OUTPUT? Thanks, best
@Adam-db6dc
@Adam-db6dc Жыл бұрын
For those using another kit like me sometimes it wont look like his but more like a chip with an LED on it and 4 legs infront on one side called an RGB Module yes..... i also got confused at first but then i googled about it and they pretty much are the same thing
@dhanushwimaladharma2524
@dhanushwimaladharma2524 Жыл бұрын
Actually This channel is underrated in my opinion.
@chrisperrott8781
@chrisperrott8781 4 жыл бұрын
Hi Paul, Thanks for the wave to the British :-) Loving the course. Stay safe.
@worldtraveler6719
@worldtraveler6719 Жыл бұрын
Love your tutorials.. and love the orange shirt :) Thank you so much
@nerdape7314
@nerdape7314 4 жыл бұрын
i still love the way he says "BOOM"
@propersplitbrainme
@propersplitbrainme 2 жыл бұрын
Also decided to do a consolidation exercise by using the potentiometer to change the colour of the RGB LED through a spectrum of colours. Got myself messed up initially while I figured out that you have to be careful to ensure you don't end up with more than one condition being true at the same time, but it worked in the end.
@alanj554
@alanj554 5 жыл бұрын
Good assignment. My kit actually comes with an RGB LED with surface mount resistors so I can just connect the wires straight to them.
@philnewman1110
@philnewman1110 Жыл бұрын
Wow! that was a difficult one, really struggled to get the yellow, but it was a great tutorial, thanks Paul.
@kbdozz
@kbdozz 3 жыл бұрын
super excited! My Elegoo kit finally arrived - just in the nic of time as I didn't have an RGB LED in my possession....Kit looks great!
@terencebarber4269
@terencebarber4269 4 жыл бұрын
Thanks for this lesson Paul. Yes here in the UK we do spell colour with the u included. Great course and i'm learning a lot. sometimes have to do the lessons again just to get it to stick in my thick skull. A constant reminder to myself is remember to ensure I put the comments into the sketch so I know exactly why I have done something.
@Wingrider07
@Wingrider07 3 жыл бұрын
After the readString statement, turn all led pins low. Then you only need 1 digital write per “if” to turn the selected led pin high.
@steveharris7476
@steveharris7476 4 жыл бұрын
Hi Paul , Kudos to you sir for the English spelling of Color. I have been coding along with you on previous Tutorials and changing the spelling accordingly. I am still enjoying the Tutorials and trying to modify the coding after seeing the videos. Sometimes it works but not always , but it dosen't stop my enthusiasm for the course. Trying to do one video course a day and at least i know if i have to go over something more than once I can just watch the video again. Keep up the Good work Paul you are doing a great job.
@markharrisllb
@markharrisllb 3 жыл бұрын
Thank you for the 'u', like everything else in your lessons it’s very much appreciated. I think I'll solder my first board and keep this one.
@geekgloryenglish2822
@geekgloryenglish2822 3 жыл бұрын
One of the Best courses in KZbin Ever!
@andrewbarrattmaher
@andrewbarrattmaher 3 жыл бұрын
Hi Paul, I'm one of you British fans, I'm new to Arduino and your lessons are interesting and useful .
@bobbyeakle9511
@bobbyeakle9511 4 жыл бұрын
Guys! If the leds aren’t turning on, try turning your serial monitor to no line ending. Hope this helps!
@bobbyeakle9511
@bobbyeakle9511 4 жыл бұрын
Thanks for liking Paul! I have tried to find tutorials for arduino online for completely new people but there weren’t really any good complete ones until I found yours! Thanks for the help!
@04fys513
@04fys513 Жыл бұрын
? I don't understand that statement. How is this done?
@04fys513
@04fys513 Жыл бұрын
I take it back. I figured it out, and it was the cause for the lights not turning on. Thanks!!!!!
@rgchevyy
@rgchevyy Жыл бұрын
Most Awesome advice!
@MinhangNguyen-ug8oz
@MinhangNguyen-ug8oz Жыл бұрын
I did it but it didn't work. I checked all the LEDs and wires and they're fine. I also added println( myColor ) to check my command but when i type "red", the result shows "redred".
@CiscoSaeed
@CiscoSaeed 5 жыл бұрын
you are welcome and waiting for continuous Arduino Tutorial. I hope to see your notification as always 😉 my coffee is ready!
@graemedurden8975
@graemedurden8975 2 жыл бұрын
Turns out the RGB LED in my kit was a common anode! I got there in the end though. Fun lesson.
@andygoundry1599
@andygoundry1599 3 жыл бұрын
As one of the Brits watching and learning: sure appreciate the color
@matthewframe92
@matthewframe92 2 жыл бұрын
I absolutely love your tutorials. I’ve been following you all the way up to lesson 20 (that’s where I’m currently at) I’ve been saving all of the sketches we do and once I finally understand what we’re doing. I go in and tweak it and see if I can’t get it to do what I want it to do. I’m gonna start commenting more. The math is very important too.
@haks_123
@haks_123 4 жыл бұрын
hi im british and i acknowledge the 'correct' spelling of colour :) thanks paul
Arduino Tutorial 19: Reading Strings from the Serial Monitor
30:19
Paul McWhorter
Рет қаралды 212 М.
Мама у нас строгая
00:20
VAVAN
Рет қаралды 10 МЛН
Hoodie gets wicked makeover! 😲
00:47
Justin Flom
Рет қаралды 134 МЛН
FOREVER BUNNY
00:14
Natan por Aí
Рет қаралды 26 МЛН
ТЮРЕМЩИК В БОКСЕ! #shorts
00:58
HARD_MMA
Рет қаралды 2,6 МЛН
Analog RGB LED Strip Control with Arduino (Lesson #29)
20:13
Science Buddies
Рет қаралды 19 М.
Arduino Tutorial 17: Understanding Arduino While Loops
21:05
Paul McWhorter
Рет қаралды 197 М.
The Future of Programming
9:30
ThePrimeTime
Рет қаралды 68 М.
What’s Behind the Light? - How WS2812B LED Strips Work
20:45
Intermation
Рет қаралды 54 М.
Why build an entire computer on breadboards?
28:43
Ben Eater
Рет қаралды 3,1 МЛН
Are you TONE DEAF or MUSICALLY GIFTED? (A FUN test for non-musicians)
11:44
Pardon my Piano
Рет қаралды 10 МЛН
Мама у нас строгая
00:20
VAVAN
Рет қаралды 10 МЛН