int pin_sensor=8;
int valor =0;
int led =13;
void setup(){
Serial.begin(9600);
pinMode(pin_sensor,INPUT);
pinMode(led,OUTPUT);
}
void loop(){
valor=digitalRead(pin_sensor);
if (digitalRead(pin_sensor)==LOW)
{
digitalWrite(led,HIGH);
}
else
{
digitalWrite(led, LOW);
}
Serial.print("sensor=");
Serial.println(valor);
}