Change GPIO Both to Rising
Change how the GPI detection workes, so it only does things on the rising edge
This commit is contained in:
@@ -57,7 +57,7 @@ GPIO.setwarnings(False)
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
GPIO.setup(12, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
|
||||
|
||||
GPIO.add_event_detect(12, GPIO.BOTH, callback=button_callback, bouncetime=200)
|
||||
GPIO.add_event_detect(12, GPIO.RISING, callback=button_callback, bouncetime=200)
|
||||
|
||||
input("Press enter to quit\n\n")
|
||||
GPIO.cleanup()
|
||||
Reference in New Issue
Block a user