int led = 13;
int sw = 2;
void setup()
{
  Serial.begin(9600);
  pinMode(led,OUTPUT);
  pinMode(sw,INPUT);       
}

void loop()
{ 
  int x;
  x = digitalRead(sw);
  Serial.print("x = ");Serial.println(x);
  digitalWrite(led,!x);  
}
