#define pinPir 2
#define luces 2

int estado = 0;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(9600);
  pinMode(luces, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  estado = analogRead(pinPir);
  //estado = map(estado, 0, 1023, 0, 1);
  Serial.println(estado);
  if(estado == 1){
    digitalWrite(luces, HIGH);
  }
  else{
    digitalWrite(luces, LOW);
  }
  delay(100);
}
