int pirPin = 35;
void setup(){
Serial.begin(115200);
pinMode(pirPin, INPUT);
}
void loop()
{
int val = analogRead(pirPin);
while (val >= 0 && val <=255)
{
if(val >= 100)
{
Serial.println("Motion Detected");
}
else if(val <= 100)
{
Serial.println("Motion Not Detected");
}
delay(1000);
}
}