const int led = 2;
const int touchOut = 3;
const int touchIn = 4;

void setup() {
  pinMode(2, OUTPUT); 
  pinMode(3, OUTPUT);    
  pinMode(4, INPUT);
}

void loop() {
  
  digitalWrite(touchOut, LOW);
  delay(1);   
  digitalWrite(touchOut, HIGH);
  delayMicroseconds(4);
  
  if (digitalRead(touchIn)== HIGH){
    digitalWrite(led,LOW);
  }
  else{
    digitalWrite(led,HIGH);
  }
  
  // wait a bit
  delay(100);                     
}
