Datasheet

5
void turnOnLED()
{
digitalWrite(LED,HIGH);
}
void turnOffLED()
{
digitalWrite(LED,LOW);
}
/***************************************************************/
/*Function: Detect whether anyone moves in it's detecting range*/
/*Return:-boolean, true is someone detected.*/
boolean isPeopleDetected()
{
int sensorValue = digitalRead(PIR_MOTION_SENSOR);
if(sensorValue == HIGH)//if the sensor value is HIGH?
{
return true;//yes,return true
}
else
{
return false;//no,return false
}
}
Note:
The detecting distance and holding time can be adjusted by adding two extra potentiometers on
board. For the details please refer to the V1.2 Eagle below. The module can also be set as
retriggerable or un- retriggerable by changing the jumper hat.
3.2 With TI LaunchPad
Is Anybody here (PIR Motion Sensor)
The following sketch demonstrates a simple application of sensing motion. When someone moves
in its detecting range, the output of the application will be high through its SIG0 pin and the LED
will turn on. Otherwise, the output will be LOW. Note that the PIR motion sensor is very sensitive
to motion!