1 LED, multiple inputs

first of all you need to debounce your buttons: http://arduino.cc/it/Tutorial/Debounce . Another thing; if you want this to truly work, do not use delay(); to blink the led as it stops the whole sketch(and thus the button press detection). see void loop for ONE way of doing the two button thing.

sorry if this is handing it to you on a silver platter, i like the practice :stuck_out_tongue:

// constants won't change. They're used here to 
// set pin numbers:
const int BUTTONpin = 12;     // the number of the pushbutton pin
const int SWITCHpin = 7;     // the number of the pushSWITCH pin

// Variables will change:
int BUTTONstate;             // the current BUTTONreading from the input pin
int lastBUTTONstate = LOW;   // the previous BUTTONreading from the input pin
long lastBUTTONDebounceTime = 0;  // the last time the output pin was toggled

int SWITCHstate;             // the current SWITCHreading from the input pin
int lastSWITCHstate = LOW;   // the previous SWITCHreading from the input pin
long lastSWITCHDebounceTime = 0;  // the last time the output pin was toggled

long debounceDelay = 50;    // the debounce time; increase if the output flickers

void setup() {
  pinMode(BUTTONpin, INPUT);
  pinMode(SWITCHpin, INPUT);
}

void loop()
{
  getSWITCHreading();
  getBUTTONreading();
  
  //SWITCHstate is the current state of the SWITCH
  //BUTTONstate is the current state of the BUTTON
  
  if(SWITCHstate==1) //if SWITCH is pressed
  {
    if(BUTTONstate == 1) //if BUTTON is pressed
    {
      //do this
    }
    else //if BUTTON not pressed
    {
      //do that
    }
  }
  else //SWITCHstate=LOW
  {
    if(BUTTONstate == 1) //if BUTTON is pressed
    {
      //do this
    }
    else //if BUTTON not pressed
    {
      //do that
    }
  }
}

void getSWITCHreading()
{
  // read the state of the switch into a local variable:
  int SWITCHreading = digitalRead(SWITCHpin);
  
  // check to see if you just pressed the SWITCH 
  // (i.e. the input went from LOW to HIGH),  and you've waited 
  // long enough since the last press to ignore any noise:  

  // If the switch changed, due to noise or pressing:
  if (SWITCHreading != lastSWITCHstate) {
    // reset the debouncing timer
    lastSWITCHDebounceTime = millis();
  } 
  
  if ((millis() - lastSWITCHDebounceTime) > debounceDelay) {
    // whatever the SWITCHreading is at, it's been there for longer
    // than the debounce delay, so take it as the actual current state:
    SWITCHstate = SWITCHreading;
  }
  
  // save the SWITCHreading.  Next time through the loop,
  // it'll be the lastSWITCHstate:
  lastSWITCHstate = SWITCHreading;
}

void getBUTTONreading()
{
  // read the state of the switch into a local variable:
  int BUTTONreading = digitalRead(BUTTONpin);
  

  // check to see if you just pressed the button 
  // (i.e. the input went from LOW to HIGH),  and you've waited 
  // long enough since the last press to ignore any noise:  

  // If the switch changed, due to noise or pressing:
  if (BUTTONreading != lastBUTTONstate) {
    // reset the debouncing timer
    lastBUTTONDebounceTime = millis();
  } 
  
  if ((millis() - lastBUTTONDebounceTime) > debounceDelay) {
    // whatever the BUTTONreading is at, it's been there for longer
    // than the debounce delay, so take it as the actual current state:
    BUTTONstate = BUTTONreading;
  }

  // save the BUTTONreading.  Next time through the loop,
  // it'll be the lastBUTTONstate:
  lastBUTTONstate = BUTTONreading;
  
}