int sw_pin = 4; //define switch pin
int sw_value = 0; 
int led_pin = 3;

void setup(){
  pinMode(sw_pin, INPUT);
  pinMode(led_pin, OUTPUT);
  Serial.begin(9600);
}

void loop(){
  sw_value = digitalRead(sw_pin);
  Serial.println(sw_value);
  delay(100);
  if(sw_value == LOW){
    digitalWrite(led_pin, LOW);
  }else{
    digitalWrite(led_pin, HIGH);
  }
}