I'd like to use some special pins like 5 (scl) and 12 (pcm_clk)as regular pins to read from them. I made a circuit as shown here:

enter image description here

and setup all connected pins like this:

GPIO.setup(pin, GPIO.IN, pull_up_down=GPIO.PUD_DOWN)
GPIO.add_event_detect(pin, GPIO.RISING, callback=onTrigger, bouncetime=700)

All regular pins are Ok, but pins 5 and 12 continuously invoke onTrigger function with closed switches despite I set big bouncetime. How can I fix this?

  • 1
    There is nothing to fix. There is something wrong with either your wiring or your software. We need to see both to be able to usefully comment. – joan Sep 3 '18 at 14:54

It looks like when the button is pushed, you have an internal pull-down fighting against an external pull-up. Perhaps you should drop the internal pull-down in your code, since the schematic is clearly designed to work with pull-ups.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.