Thanks. I am learning all the time. I now want to randomise the periods ...
@scottwait35854 ай бұрын
Thank you Paul!!
@kilroy797634 ай бұрын
Thanks Paul! - kilroy
@deniszawad4 ай бұрын
Great timing. ; - )
@jwaddin3 ай бұрын
Top G
@YousefHurf4 ай бұрын
The Ring Programming Languge can now handle raspberry PI :)
@charlotteswift4 ай бұрын
Hi Everyone I've made 2 videos that you may (or may not) be interested in. You-know-who has deleted my previous comments because of the links. My first video is called 'My (personal) video to remind me how I did Paul McW's Pico W Lesson 80.' and it shows how you can deinitialise timers without having to use any global variables. My second video is called 'My video for Paul McWhorter's Pico W Lesson 81a - Binary counter using a variable number of LEDS'. I realised that perhaps people might find this useful after I watched Arnold setting up 8 timers one-by-one.
@patrickfox-roberts75284 ай бұрын
👍👍👍
@larryplatzek90174 ай бұрын
I hope this is not the last LESSON, I see no other lesson showing in the playlist!
@paulmcwhorter4 ай бұрын
Larry, I am working through the next lesson. They should be up and ready before existing ones run out.
@jbelmont722 ай бұрын
I believe there is a problem with the synchronization of the One_Shot timers. In my code I created two periodic callbacks each containing one-shot timers with a full second difference(green and red).They should be visibly out of synchronization right away. But that is not so. But predictably by 25-28 seconds, the apparent non-synchronization crashes the program. I have investigated Ms Swift's approach but that has been ineffective in my hands as well. This is the program I am running: import time from machine import Pin,Timer rPin=17 gPin=16 bPin=13 rLed=Pin(rPin,Pin.OUT) gLed=Pin(gPin,Pin.OUT) bLed=Pin(bPin,Pin.OUT) def Function(source): print('Hi') def greenOff(source): gLed.value(0) print('Green Off') def blueBlinker(source): bLed.toggle() def redOff(source): rLed.value(0) print('Red Off') def redBlinker(source): rLed.value(1) print('Red On') red_off_timer=Timer(period=100,mode=Timer.ONE_SHOT,callback=redOff) def redOff(source): rLed.value(0) print('Red Off') def greenBlinker(source): gLed.value(1) green_off_timer=Timer(period=1000,mode=Timer.ONE_SHOT,callback=greenOff) x=0 blueTimer=Timer(period= 2000,mode=Timer.PERIODIC,callback=blueBlinker) redTimer=Timer(period=2000,mode=Timer.PERIODIC,callback=redBlinker) greenTimer=Timer(period=2000,mode=Timer.PERIODIC,callback=greenBlinker) try: while True: print(x) time.sleep(1) if x%5==0: blue_one_shot=Timer(period=4000,callback=Function) x+=1 except KeyboardInterrupt: print('all done') # red_off_timer.deinit() redTimer.deinit() # buzzerTimer.deinit() greenTimer.deinit() blueTimer.deinit() rLed.value(0) gLed.value(0) bLed.value(0) Any suggestions on remedying this desynchronization ( as I surmise it to be)?
@charlotteswift4 ай бұрын
Here is the video for my solution to lesson 81: kzbin.info/www/bejne/jourmn6mmMl7oKssi=v7XBRRYhHT6J8jP4 It shows that you can pass parameters to a callback.
@paulmcwhorter4 ай бұрын
LEGEND!
@shawnlowe13924 ай бұрын
So I got it to work with pause. The reason yours didn't work is time.sleep is in seconds, not milliseconds. So my code of led.on, time.sleep(.1), led.off worked. But you are correct it isnt the right way to do it. I thought this homework was too simple! lol
@paulmcwhorter4 ай бұрын
Excellent point.
@pralaymajumdar12063 ай бұрын
❤❤
@shawnlowe13924 ай бұрын
I am Legend! lol
@paulmcwhorter4 ай бұрын
LEGEND!
@edSabio5724 ай бұрын
I folded up like cheap walmart lawn chair : (
@VeryUsMumblings4 ай бұрын
Last minute homework submission! Thanks! kzbin.info/www/bejne/iX3JlYFmd92kg80
@paulmcwhorter4 ай бұрын
LEGEND!
@pelabarr4 ай бұрын
Here is my solution to lesson 81's binary counter homework: kzbin.info/www/bejne/qJ62Z2Znp6p-f7s Anyone know why I have to post comments twice for them to take?
@paulmcwhorter4 ай бұрын
LEGEND!
@scottpettygrove78214 ай бұрын
Thanks for the great lesson, Paul! Here's my homework solution - kzbin.info/www/bejne/kHjLgoF-gNmNbLcsi=wpj0KAwyZlFJaIr4