RPI.GPIO Help
John McKenzie
davros at bellaliant.net
Wed Sep 2 14:50:36 EDT 2015
Hakugin: Thanks for the correction. Someone elsewhere showed me example
code that was very close to yours, with that being the main difference.
His gave an error message that red_button was undefined so I moved the
code block below the callbacks. After that it ran without producing
errors but it was unresponsive. Will try your updated version tomorrow
and will keep fiddling with his.
Thank you all for warning me about debouncing. The RPi.GPIO library has
built in debouncing. You can even adjust the timing of it.
Turns out I got one thing right. Someone who knows better than I
explained that GPIO.Cleanup() does go at the bottom and outside the def
exit_handler() code block like I had it originally.
Johannes: Thanks for sharing that. I will take a look at it when I have
more time. Must head to the hospital for my treatment in a few minutes.
>Are you still calling GPIO.add_event_detect in a while loop?
MRAB, apparently yes. Hakugin noticed and update his example code.
More information about the Python-list
mailing list