Raspberry Pi - How to Handle GPIO Interrupts with Python 3

preview_player
Показать описание
Learn how to use GPIO interrupts on your Raspberry Pi, using the RPi.GPIO library. Step by step explanation for both wait_for_edge() and add_event_detect() functions.

0:00 Intro
0:18 Circuit with Raspberry Pi and push button
0:55 How GPIO interrupts work
2:21 Setup the GPIO
4:08 Interrupts with GPIO.wait_for_edge()
6:35 Interrupts with GPIO.add_event_detect()
12:34 Use GPIO.BOTH to detect RISING and FALLING in the same interrupt
14:36 Outro

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

Super video, this makes me want to we watch some more of your content!

davidjohnston
Автор

Well explained and well deserved for the like and the subscription

norbertbans
Автор

Great and detailed video, quality work!

IZZY
Автор

A most excellent GPIO callback demo. Will this work on the newer Orange Pi-5 Debian-Bullseye Python? Thank you.

qzorn
Автор

Thank you for the video. I'm confused about what bouncetime means

dravera
Автор

I am currently using Quadrature encoder so I wanted to monitor two pins simultaneously using the event functions to see which pin gets the rising edge FIRST. Please help

ShreedharShah
Автор

Is this a real interrupt? I mean, if I am running this python script, will the CPU be completely occupied with reading GPIO, or it actually uses the interrupt feature of microcontroller?

Debraj
Автор

I have a function that takes over 10 seconds to run. So I need to disable the GPIO Interrupt until the function has done its job, then reenable the GPIO Interrupt. How can I do this?

MrSirPain
Автор

i am getting error: Error adding event detection: Failed to add edge detection
. By using polling method on button works fine but somehow cant figure out what is causing failing edge detection when trying to use interupts. Any suggestion?

jozefsoucik
Автор

sir how to print emoji in raspberry pi tkinter gui ?

Indian
Автор

My Pi keeps crashing once the line GPIO.setup(pin#, GPIO.OUT)
Is introduced and I can’t figure out why. Still does it with absolutely nothing connected.

jace_Henderson
Автор

when I hear the word Python, I go away. Why not do this in C or C++. Also from what I've read, the Linux kernel does not provide interrupts. Now I'm confused.

dalesmith