Multiple momentary switches - help with coding

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
marsman12019
 
Posts: 11
Joined: Wed Jan 18, 2012 1:02 am

Multiple momentary switches - help with coding

Post by marsman12019 »

Quick question:

If I have multiple momentary switches/buttons on four different inputs, how would I go about responding to only one button, even if others are pressed while the first is being pressed, i.e., button1 turns on LED1, button2 turns on LED2, etc., but LED2 can't be on while LED1 is on.

I'm looking for a direction to get me started here, rather than just the answer; learning is a process.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Multiple momentary switches - help with coding

Post by adafruit_support_bill »

Look at the '6 button' examples in the WaveShield tutorial.

marsman12019
 
Posts: 11
Joined: Wed Jan 18, 2012 1:02 am

Re: Multiple momentary switches - help with coding

Post by marsman12019 »

Fantastic. Thank you for your help!

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”