Тёмный

Raspberry Pi Pico W LESSON 81: Creating Asymmetric Pulses Using Timers 

Paul McWhorter
Подписаться 386 тыс.
Просмотров 1,9 тыс.
50% 1

Опубликовано:

 

29 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 36   
@nigelworwood8530
@nigelworwood8530 2 месяца назад
Thanks. I am learning all the time. I now want to randomise the periods ...
@kilroy79763
@kilroy79763 2 месяца назад
Thanks Paul! - kilroy
@scottwait3585
@scottwait3585 2 месяца назад
Thank you Paul!!
@charlotteswift
@charlotteswift 2 месяца назад
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.
@deniszawad
@deniszawad 2 месяца назад
Great timing. ; - )
@charlotteswift
@charlotteswift 2 месяца назад
Here is the video for my solution to lesson 81: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-XZHiKpcdHjI.htmlsi=v7XBRRYhHT6J8jP4 It shows that you can pass parameters to a callback.
@paulmcwhorter
@paulmcwhorter 2 месяца назад
LEGEND!
@larryplatzek9017
@larryplatzek9017 2 месяца назад
I hope this is not the last LESSON, I see no other lesson showing in the playlist!
@paulmcwhorter
@paulmcwhorter 2 месяца назад
Larry, I am working through the next lesson. They should be up and ready before existing ones run out.
@YousefHurf
@YousefHurf 2 месяца назад
The Ring Programming Languge can now handle raspberry PI :)
@patrickfox-roberts7528
@patrickfox-roberts7528 2 месяца назад
👍👍👍
@jwaddin
@jwaddin Месяц назад
Top G
@pralaymajumdar1206
@pralaymajumdar1206 Месяц назад
❤❤
@jbelmont72
@jbelmont72 28 дней назад
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)?
@shawnlowe1392
@shawnlowe1392 2 месяца назад
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
@paulmcwhorter
@paulmcwhorter 2 месяца назад
Excellent point.
@shawnlowe1392
@shawnlowe1392 2 месяца назад
I am Legend! lol
@paulmcwhorter
@paulmcwhorter 2 месяца назад
LEGEND!
@VeryUsMumblings
@VeryUsMumblings 2 месяца назад
Last minute homework submission! Thanks! ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-SLfdN0BxqMk.html
@paulmcwhorter
@paulmcwhorter 2 месяца назад
LEGEND!
@pelabarr
@pelabarr 2 месяца назад
Here is my solution to lesson 81's binary counter homework: ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-rmS631rEKIY.html Anyone know why I have to post comments twice for them to take?
@paulmcwhorter
@paulmcwhorter 2 месяца назад
LEGEND!
@edSabio572
@edSabio572 2 месяца назад
I folded up like cheap walmart lawn chair : (
@scottpettygrove7821
@scottpettygrove7821 2 месяца назад
Thanks for the great lesson, Paul! Here's my homework solution - ru-vid.com/video/%D0%B2%D0%B8%D0%B4%D0%B5%D0%BE-ZGhQNHKtZ6U.htmlsi=wpj0KAwyZlFJaIr4
@paulmcwhorter
@paulmcwhorter 2 месяца назад
LEGEND!
@ASHISHKUMAR-ej1fy
@ASHISHKUMAR-ej1fy 2 месяца назад
Provide correct code and files
@detroiter4eva
@detroiter4eva 2 месяца назад
That sounds like a winner.
@pralaymajumdar1206
@pralaymajumdar1206 Месяц назад
❤❤
Далее
Hacking a weird TV censoring device
20:59
Просмотров 3,2 млн
The Raspberry Pi Pico WAS Overrated! But that changed!
10:18