Closed tom9672 closed 2 years ago
... def btn_pressed(pin): print(pin,'pressed') GPIO.add_event_detect(26, GPIO.RISING, callback=btn_pressed, bouncetime=200) ...
works as expected, one press and one print.
.... for cmd in [6,7,15]: output_data.Control_Word = cmd self.slave.out_put = bytes(output_data) time.sleep(0.02) ... def btn_pressed(pin): print(pin,'pressed') GPIO.add_event_detect(26, GPIO.RISING, callback=btn_pressed, bouncetime=200) ...
It keeps outputting that the button is clicked, but I don't get the button clicked. I tested to remove the 15, it works as expected.
solved, I connected the NC instead of NO contact point of the mechanical button, then the issued solved, but still don't know why ...
works as expected, one press and one print.
It keeps outputting that the button is clicked, but I don't get the button clicked. I tested to remove the 15, it works as expected.