Multiple buttons with single wire input, help needed.

Thanks for the reply!

I know the code I provided won't give the desired result, it was just more or less the foundation that I'm building off of.

I've been fighting with this all night and finally stripped it down to a single led, coded it as if it was a digital switch just provding high or low, and not an analog. Then I just went back and added my if() statements. Finally it works! Now I'd just need to add separate booleans for each of my four LEDS but I might actually be able to handle that. :stuck_out_tongue:

If anyone is interested here is the working code:

/*

 Desired Effects:
 Led One, When button one is pressed, LED one is On. 
 Do not change state untill button is released and pressed again.
 
 */

// Define Constants
const int switcharrayPin=A0; // Set switch array pin to analog pin 0
const int ledonePin=11; // Set LED pin to 11

// Define Variables
boolean switchonecurrent=false; // Boolean to hold current switch position
boolean switchonelast=false; // Boolean to hold last switch position
long int switcharrayvalue=0; // Keep track of the switch value between 0 and 1280



void setup()
{
  pinMode (switcharrayPin, INPUT); //set switch array pin to an input
  pinMode (ledonePin, OUTPUT); // set switch array pin to an output
}




void loop()
{
  switcharrayvalue=analogRead(switcharrayPin); // Read Switch Array
  if(switcharrayvalue > 350 && switcharrayvalue < 550 && switchonelast==false)// See if switch one is pressed when it was not pressed before
  {
    switchonecurrent = !switchonecurrent; // If so, flip switch ones value
    switchonelast=true; // If so, make switch ones last state to true
  }
  else
  {
    if(switcharrayvalue < 350 || switcharrayvalue > 550)// See if button one is not pressed
    {
      switchonelast=false; // If it's not, set switch ones last state to false
    }
  }

  digitalWrite(ledonePin,switchonecurrent); // Write switch ones current state to LED One
}