Mr.Paul, I have successfully written the micropython code for lesson 19 Button control of RGB LED and is perfectly working. This was the home work given by you at the end of lesson 18. Your teaching is amazing, thank you so much😊.
I actually did it! Thanks for all of your content!
Got homework done and working. Coded two programs. Used PWN got working then second using the not command and got it working.
I've rather pre-empted what I think this week's homework will be with this solution as I won't be able to do any homework for at least 2 weeks.
I've previously used the dht11 and lcd1602 with the pico about 8 months ago when I was trying to do all of Paul's Raspberry Pi lessons using a pico. There's a link to the old (terrible) video in the description.
Here's the new video: ua-cam.com/video/mfymYrhpRzY/v-deo.html
Great class Paul. Looking forward to the Temp & Humidity class. Thanks
For me it is use it or loose it. The more I go over Micropython examples, the more it makes sense. 😎 Thank you.
Thanks Paul, I am late to the party but wanted to include my solution below. I took the approach of using an array based off your "Understanding Variables and Arrays" Lesson. It worked well.
from machine import Pin
from time import sleep
LEDGPin=15
LEDBPin=13
LEDRPin=14
myGLED=Pin(LEDGPin,Pin.OUT)
myBLED=Pin(LEDBPin,Pin.OUT)
myRLED=Pin(LEDRPin,Pin.OUT)
buttonGpin=16
buttonRpin=17
buttonBpin=18
myGbutton=Pin(buttonGpin,Pin.IN,Pin.PULL_UP)
myRbutton=Pin(buttonRpin,Pin.IN,Pin.PULL_UP)
myBbutton=Pin(buttonBpin,Pin.IN,Pin.PULL_UP)
buttonstatenow=[1,1,1]
buttonstatepress=[1,1,1]
RLEDstate=False
BLEDstate=False
GLEDstate=False
while True:
buttonstatenow=[myBbutton.value(),myRbutton.value(),myGbutton.value()]
if buttonstatenow[0]==1 and buttonstatepress[0]==0:
BLEDstate= not BLEDstate
myBLED.value(BLEDstate)
if buttonstatenow[1]==1 and buttonstatepress[1]==0:
RLEDstate= not RLEDstate
myRLED.value(RLEDstate)
if buttonstatenow[2]==1 and buttonstatepress[2]==0:
GLEDstate= not GLEDstate
myGLED.value(GLEDstate)
print(GLEDstate,RLEDstate,BLEDstate,buttonstatenow,buttonstatepress)
buttonstatepress=buttonstatenow
sleep(.1)
Great video Paul.
Thank you Paul for an interesting class.
I love that background river❤😮
Yes I teach with the headwaters of the mighty River Nile behind me. Actually enjoy taking a boat down the river when we have company.
Thanks Paul! Great presentation. My code worked but lacked the elegance of yours. Note: the button switches are on the weak side and had trouble with the connection to the breadboard.
Will get some color switches like yours when I get back to the states. My European vacation has come to an end...As always, looking forward to your next lesson. : )
Very good Channel. Thanks.
Thanks Paul!
I am legend🤣, could solve it. Now I have a breadboard with three pushbuttons, a RGB LED and a pico W and can light up three colors...😎.Nice lesson though.
Paul, will you be covering raspberry pi pico PIO assembly coding?
With my code, inside if commands I turned off the other two colors and prevented the mixing of colors. So it's possible to toggle the colors with a few extra lines of code.
Music sounds like something out of a David Bowie movie
I made rgb wifi controled buttons working not recorded yet . Will be on line later today .
What do you call a beehive without any exits
Hi Paul, I was wondering if it is possible to connect a camera to a Pico W and send the frames to a Jetson nano through Wi-Fi. I have been following your AI for Everyone Course and I’m trying to figure out a security system with the Jetson Nano I bought. If anyone else knows the answer to this too please let me know. Thanks!
For this case I would suggest using the Raspberry Pi Zero W. That board is about $15 and can do what you want.
Unbelievable
Your spelled your blue variable wrong in the get value statement
I did object-oriented approach
from machine import Pin
import time
class LedButton:
def __init__(self, *,ledPin,inputPin):
self.ledPin = Pin(ledPin, Pin.OUT)
self.inputPin = Pin(inputPin,Pin.IN,Pin.PULL_UP)
self.startval = self.inputPin.value()
def toggle_led(self):
self.ledPin.value(not self.ledPin.value())
def get_input(self):
currentval = self.inputPin.value()
if self.startval == 1 and currentval == 0:
if self.inputPin.value() == currentval:
self.toggle_led()
time.sleep(0.05)
self.startval = currentval
def main():
ledRbutton = LedButton(ledPin=18, inputPin=13)
ledGbutton = LedButton(ledPin=16, inputPin=12)
ledBbutton = LedButton(ledPin=17, inputPin=9)
while True:
ledRbutton.get_input()
ledGbutton.get_input()
ledBbutton.get_input()
time.sleep(0.1)
main()
I had built my coffee with syrup and whole milk… when I powered it up, the whole thing exploded 😔
Statement 28
Thanks Paul!
Thanks Paul!
Great lesson. Nice to show the process for debugging your code and circuit. Thanks!