Reading normally closed momentary pushbutton

Status
Not open for further replies.

pgutoski

New member
I'm trying to read momentary pushbuttons that have two poles - one is normally closed; the other normally open.

I'm able to read the normally open contacts using the bounce library without any problem, but can't figure out how to modify the code to read the normally closed contacts. Any guidance would be greatly appreciated!
 
Before spending more time on the software, I'd use a voltmeter to check that Teensy's pin really is getting a proper logic low and logic high when the switch is in its 2 states.

If you're using the Bounce library in the way all of Teensy's examples show, this should just be a matter of replacing every fallingEdge() with risingEdge() and vise versa.

If you're using different Bounce features, well, hard to advise about code I can't see!

Then again, if you already have the pushbuttons working using their normally open contact, I don't quite understand why you would bother with also using a normally closed contact. Isn't that redundant?
 
I'm making a multi-player game based on timing. The NC contacts of the switches I've got open first, and then continued pressing closes the NO contacts. So reading the NC contacts opening would provide the quickest possible feedback.

I have written any code yet - I've just been playing with the bounce example(s) to see how to read a button going to an open state.
 
Status
Not open for further replies.
Back
Top