New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Push button event itself without pushing #134
Comments
I'd like to know more about what system software is running on your BeagleBone. Please paste the output of:
Please ensure your running the latest version of Adafruit_BBIO which is
Finally, please post the Python code that you are running so that I can attempt to reproduce the issue. |
Hi The code I use :
When I push intentionally the button, Sometimes I get two event detected, sometimes one, even if I wrote GPIO.RISING. Random behaviour. |
Do you get an error when trying to upgrade to v1.0.3 via pip? Alternatively, have you tried cloning this repo and installing it? |
Installing is not the problem. My program (not this one, this one is jsut for test) is not working and I get a specific error, everytime the same. Didn't investigate further. I don't remember the error exactly, but it was an error about pyserial if I remember well. |
I've run your example and I see the issue you describe. I think the issue is that there needs to be debouncing.
Could you replace the while loop with a callback to handle the button press? |
I did it's what the "test" function is for. |
I believe you should have a look on event_detected. |
Ok, thanks, I'll investigate further. |
Super. Keep me inform when you get news. If you need some help don't hesitate. |
Hi do you have news ? |
@LudovicGuerra Sorry for the delay. I've been traveling but have returned home now. I'll follow up by tomorrow (March 1). |
@LudovicGuerra To test, I modified source/event_gpio.c in order to gain insight into what is happening. Here is the test program
I run the program with P8_16 disconnected and then I connect wire to 3.3V:
Do you get these same results? |
Hi. |
Hi, The debounce parameter is not strictly a debounce, it is a throttle - which can be a bit misleading. This means that button presses, particularly with mechanical buttons or connecting wires will generate many high and low glitches until the button is steady (which could take hundreds of milliseconds, and glitches can occur on microsecond periods). If these glitches take a long time to settle, longer than the throttle window you will get multiple events. On the other hand, a pure debounce will not trigger until the glitches have stopped for more than the debounce time. A continuously glitching line will never trigger the event, as the debounce windows is continuously pushed out. I have used a simple debounce decorator from @walkermatt on gitHub which i wrap around my
|
@JesseMcL thanks for the insights and the code example. I'll try it out. This seems like something I should add as an example in the documentation. |
@LudovicGuerra I'm going to close this but please re-open if you are able to test again and have problems |
Hi all.
I am working on BBG. Im using Python2
I got a problem link to Adafruit driver.
I got a Beaglebone with a push button on a GPIO.
I plug on the GPIO a oscilloscope.
And on a console I print if the event is detected ty to the function GPIO.event_detected
The problem is :
Sometimes I don't push the button, the oscilloscope show nothing but I got a message "Button pushed".
Can someone relate this problem or cross-check ?
Thanks.
The text was updated successfully, but these errors were encountered: