Closed anthonywittig closed 6 years ago
Hi,
We analyzed the problem carefully.
This is because the motor is a high-power electrical device, the power supply voltage is pulled down at the start of the moment, resulting in GPIO18 pin signal changes, the program misjudged, and then closed the relay. Debounce way with the language of C and Python are not the same, which leads to the differences.
We decided to modify the circuit and separate the control part from the load part to solve this problem.
Thanks.
Thanks!
Hello,
When running the C code for chapter 14 everything works as expected. When running the Python code, the button has a duplicate event after the
bouncetime
. I was wondering if I was the only person to experience this behavior.I modified the code as follows (see sections titled
### New code to test duplicate events
) and for 10 seconds I see ~33Skipping button press...
output lines (corresponding to the bounce time of 300 and the 10 second ignore).I've got a RPi 3 B+. Thanks for any insight you might be able to provide.
Output looks like this with a single button push:
If I unplug the motor, there aren't any duplicate events.