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

  Рет қаралды 2,104

Paul McWhorter

Paul McWhorter

Күн бұрын

Пікірлер
@nigelworwood8530
@nigelworwood8530 4 ай бұрын
Thanks. I am learning all the time. I now want to randomise the periods ...
@scottwait3585
@scottwait3585 4 ай бұрын
Thank you Paul!!
@kilroy79763
@kilroy79763 4 ай бұрын
Thanks Paul! - kilroy
@deniszawad
@deniszawad 4 ай бұрын
Great timing. ; - )
@jwaddin
@jwaddin 3 ай бұрын
Top G
@YousefHurf
@YousefHurf 4 ай бұрын
The Ring Programming Languge can now handle raspberry PI :)
@charlotteswift
@charlotteswift 4 ай бұрын
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-roberts7528
@patrickfox-roberts7528 4 ай бұрын
👍👍👍
@larryplatzek9017
@larryplatzek9017 4 ай бұрын
I hope this is not the last LESSON, I see no other lesson showing in the playlist!
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
Larry, I am working through the next lesson. They should be up and ready before existing ones run out.
@jbelmont72
@jbelmont72 2 ай бұрын
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)?
@charlotteswift
@charlotteswift 4 ай бұрын
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.
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
LEGEND!
@shawnlowe1392
@shawnlowe1392 4 ай бұрын
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 4 ай бұрын
Excellent point.
@pralaymajumdar1206
@pralaymajumdar1206 3 ай бұрын
❤❤
@shawnlowe1392
@shawnlowe1392 4 ай бұрын
I am Legend! lol
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
LEGEND!
@edSabio572
@edSabio572 4 ай бұрын
I folded up like cheap walmart lawn chair : (
@VeryUsMumblings
@VeryUsMumblings 4 ай бұрын
Last minute homework submission! Thanks! kzbin.info/www/bejne/iX3JlYFmd92kg80
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
LEGEND!
@pelabarr
@pelabarr 4 ай бұрын
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?
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
LEGEND!
@scottpettygrove7821
@scottpettygrove7821 4 ай бұрын
Thanks for the great lesson, Paul! Here's my homework solution - kzbin.info/www/bejne/kHjLgoF-gNmNbLcsi=wpj0KAwyZlFJaIr4
@paulmcwhorter
@paulmcwhorter 4 ай бұрын
LEGEND!
@ASHISHKUMAR-ej1fy
@ASHISHKUMAR-ej1fy 4 ай бұрын
Provide correct code and files
@detroiter4eva
@detroiter4eva 4 ай бұрын
That sounds like a winner.
@pralaymajumdar1206
@pralaymajumdar1206 3 ай бұрын
❤❤
Raspberry Pi Pico W LESSON 83: Using Interrupts in Micropython
40:25
Paul McWhorter
Рет қаралды 2,4 М.
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН
Une nouvelle voiture pour Noël 🥹
00:28
Nicocapone
Рет қаралды 9 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Pi Pico W with the Arduino IDE | Using WiFi
49:26
DroneBot Workshop
Рет қаралды 160 М.
Pico W Episode 1: Setting Up the Raspberry Pi Pico W
12:48
Lori Pfahler
Рет қаралды 16 М.
They Never Shipped, So I Built My Own Focus Dial from Scratch
17:34
Salim Benbouziyane
Рет қаралды 92 М.
Raspberry Pi Pico W: Wireless Weather Station
17:13
ExplainingComputers
Рет қаралды 299 М.
This tiny computer changes EVERYTHING
15:57
Jeff Geerling
Рет қаралды 884 М.
I Made Chess 2.0
14:32
From Scratch
Рет қаралды 1,2 МЛН
How does a USB keyboard work?
34:15
Ben Eater
Рет қаралды 3,3 МЛН
Каха и дочка
00:28
К-Media
Рет қаралды 3,4 МЛН