Raspberry Pi Pico W LESSON 12: Understanding and Controlling an RGB LED in MicroPython

preview_player
Показать описание
You guys can help me out over at Patreon, and that will help me keep my gear updated, and help me keep this quality content coming:

In this class we will be using the Sunfounder Raspberry Pi Pico W Keppler Kit. It will make things a lot easier if we are working on identical hardware. the link below is to amazon, and is for the identical hardware I will be using in this entire class.

In this introductory video, I will show you how to understand and use the Red, Green, Blue (RGB) LED. I will explain the operation of the LED, and show a simple circuit and program to control the color of the LED in micropython. This class is for absolute beginners, and I do not assume you already understand the material I am presenting. My goal is not to 'Show Off', but to genuinely teach you how you can do this type of work and projects on your own. I will show all work step-by-step, with clear instructions Enjoy!

#raspberrypipico
#rgbled
#micropython
Рекомендации по теме
Комментарии
Автор

Wow! I googled you to get the a previous lesson (for string input for the homework assignment) and you were second in the search to Paul McCartney!

drdentin
Автор

Another great lesson Paul. Unfortunately a combination of work and my daughter's wedding mean my homework will be a bit late this week! (I haven't folder up like a cheap Wal-Mart lawn chair yet ;) )

kevuk
Автор

I AM LEGEND! But I would not brag about my orange or yellow. 😊 Thanks for another most-excellent lesson, Paul.

cbrombaugh
Автор

Thanks Paul. As my RGB led is common anode LED that's why the longest pin will be inserted into Vcc and if I want to turn on one of the colour (red/green/blue) then that colourBright will be -- 0 and others will be 65536/65550.
Eg- redBright = 0
greenBright = 65536
blueBright = 65536 then the red LED will turn on.
Thanks again.

rupadarshisamanta
Автор

Finally, managed it. Better late than never. Found I had to turn the green down to get a decent orange. The main problem was trapping an invalid input such as brown. After some reading I ended up using elif and else commands. Interested to see the solution.

petergoss
Автор

Thanks Paul! I did my homework but I am hoping to see your solution. I do know that the last Three colors are a combination of
max values. However, something tells me you are going to do it different... Cannot claim legend nor Walmart's chair

edSabio
Автор

I think we are of similar age. I have seen Wings later Paul McCartney several times, never saw the Beatles. I suspect you are familiar with McCartney.

drdentin
Автор

All Paul's lessons are fun! Not easy for me, because coding requires a lot of memorization. But the challenge to learn is something that is a deep desire. Also Ardunino Lessons 20 & 21 and Raspberry Pi Lessons 11, 12, 13 relate to RGB Led's. Similar but different information.

ctlancearrowlarson
Автор

Hey Paul! Great lesson! Why is there a delay (sleep) in the program? Doesn't the PWM signal take care of delaying? Are you just doing it just for good measure? Thanks Paul!

danielsaenz
Автор

Crazy memory exercise for coding in Lessons 1-12. #1 Blink board LED. #2 Blink red LED. #3 Blink board LED with toggle. #4 Read analog voltages with a potentiometer. 5. Control intensity of red LED using potentiometer. 6. Change intensity of LED (not using while True:). 7. RGB-LED Change LED colors, full brightness. 8. RGB-LED Change LED colors & brightness. After while True: Use red, green, & blue (Bright), to change color & brightness (0-65550). 9. RGB-LED Change LED colors & brightness. After while True: Use duty and sleep. 10. RGB-LED Ask what color? Changes LED colors (red, green, blue). After while True: Use red, green & blue (Bright) or duty. This may not make sense to the reader, or me.

ctlancearrowlarson
Автор

Looking forward to digging further into the pico W. Thanks Paul.

briankelly
Автор

If lines #9, 11, 13 (freq) and line 23 (sleep) are commented out, the program still appears to work. It's still best to leave them in program.

ctlancearrowlarson
Автор

Mh this code doesnt work for me. My Thonny is sayig:
Error in line 28
KeyboardInterrupt

Does anyone knows what this could mean and how to solve this?

Acetylcholin
Автор

Is your BB website still up and running ?

andrewferg
Автор

I do have a question though. In all of my research the maximum value for PWM on the pico is 65535 ((2 ** 16) - 1 or 0xFFFF) but even though you've at least mentioned this value a time or two you tend to use 65550 (0x01000E). Why does this work? Does the pico just treat any high out of range number as 65535? Thanks.

jimworden
Автор

Thank you for the great lesson!
The homework:

rassulkuatov
join shbcf.ru