Noisy buttons with Teensy 3.6

Status
Not open for further replies.

kdharbert

Well-known member
I've only used buttons with Teensy 4.1 so far. I'm using a button with a Teensy 3.6 and behavior is strange. I'm running the simple push-button-play-wave-from-SD-Card sketch that is in the audio library. If I connect a wire to ground and poke all the button pins everything works right. If I connect the actual button, the interrupt constantly triggers when the button is not pressed. If I press the button, the interrupt stops triggering.
The input pins are configured for pullup and worked properly with the direct wire test so either the button is somehow super noisy or the input pullups on the T36 are different\weaker than T41? I tried several buttons and they all seem to be doing this.
Does this sound similar to anything that's been covered before?
 
Buttons and interrupts are not friends. The button bouncing makes things more complicated than necessary. It is existent on both CPUs - on every cpu - because it is the button that bounces.
So the solution is: Don't use Interrupts for buttons.
The is a nice lib called "bounce" or "bounce2" which can help.
 
Status
Not open for further replies.
Back
Top