Raspberry Pi Pico W LESSON 84: Debounce Pushbutton Switches Using Interrupts

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 video, I will show you how to create a hardware interrupt on the Raspberry Pi Pico W in micropython. We will see how we can attach an interrupt to a GPIO pin, and then have it run in the background. For this example we will examine the case of a pushbutton switch. We look at the issue of switch bounce, and show how to remover the problem of switch bounce using hardware interrupt.

More great content at:

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

Thanks Paul! Your mistake on line 13 shows you are real teacher not afraid to show your human side. I made my ckt fail on the 20th attempt and need to admit my shortcomings...Thank you so

edSabio
Автор

I have always thought it was a good idea to leave in the "mistakees" and watch you sort it out. We learn so much. Now after 83-84 lessons I are now spotting the "errrors". Although for me this took a little time as I write all the global values separately.

nigelworwood
Автор

MY FIRST and THE BEST INSTRUCTOR in ROBOTICS!!! Great Thank You, Sir! God bless you and all your works!!

MrHydyr
Автор

Brilliant solution; very clearly explained. I tried to figure it out using your homework programming hint, but folded like a Walmart chair. Thanks!

quaternion-pi
Автор

Homework is complete, but it took me 52 lines of code. It works (all the time), it's functional but too long. I used counters for the 2, 4 and 8 and reset the counters back to zero after each toggle. Can't wait to see your answer. Love the homework assignments.

craigflorin
Автор

Great solution! I could not figure what would work even with last weeks hint. My solution worked rock solid but used a Timer.
So I folded up like a cheap Walmart lawn chair.
Thanks Paul for all you do.

keithlohmeyer
Автор

I got it to work in 61 lines of code using tuples to select the pertinent values of the press variable.

louistoweill
Автор

Okay I'll start - I folded like a cheap lawnchair! I could not get my head around the timing aspect

shawnlowe
Автор

I folded up like a cheap Walmart lawn chair ... several times, with much research, and many different ways. A few minutes into the video "chalk talk", I got my ah ha moment. Good lesson. Thank you!

craigflorin
Автор

Thank you and l need something from you sir
Can you make lesson about pca9685

امينعبدالحافظعبدالباريياسين
Автор

Thanks Paul - would it work with a Volatile rather than a Global declaration in the function as none of the vars are used outside of the function?

patrickfox-roberts
Автор

You-know-who obviously didn't like my previous comment containing the link to my video for lessons 83 & 84.
Therefore I'll try again - once with the link and once without. This is obviously without the link.

charlotteswift
Автор

Tried to incorporate a timer, but just used an interrupt and bitwise operators.

quaternion-pi
Автор

Much simpler debounce:
1. detect rising edge
2. after 10ms check if HIGH

U_Kamrc
Автор

Okay, after watching, I see where my logic error was. Going to have the homework done for next by golly!! Thanks Paul

shawnlowe
Автор

Paul- do you have thoughts on integrating the pico 2 into your classes(especially when they introduce a ‘W’) version)?

jeraldgooch