upm  1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
Public Member Functions

API for the BISS0001 Motion Sensor. More...

Detailed Description

PIR sensors allow you to sense motion, almost always used to detect whether a human has moved in or out of the sensors range. They are small, inexpensive, low-power, easy to use and don't wear out. For that reason they are commonly found in appliances and gadgets used in homes or businesses. They are often referred to as PIR, "Passive Infrared", "Pyroelectric", or "IR motion" sensors.

biss0001.jpg
// Instantiate a Grove Motion sensor on GPIO pin D2
upm::BISS0001 motion(2);
while (shouldRun) {
bool val = motion.value();
if (val)
cout << "Detecting moving object";
else
cout << "No moving objects detected";
cout << endl;
upm_delay(1);
}

Public Member Functions

 BISS0001 (unsigned int pin)
 
 ~BISS0001 ()
 
bool value ()
 
bool motionDetected ()
 

Constructor & Destructor Documentation

BISS0001 ( unsigned int  pin)

BISS0001 motion sensor constructor

Parameters
pinDigital pin to use

Here is the caller graph for this function:

~BISS0001 ( )

BISS0001 destructor

Here is the call graph for this function:

Member Function Documentation

bool value ( )

Gets the motion value from the sensor.

Returns
true if motion was detected, false otherwise.

Here is the call graph for this function:

Here is the caller graph for this function:

bool motionDetected ( )
inline

Gets the motion value from the sensor. This is a more informative method name, but we want to keep compatibility with the original for now.

Returns
true if motion was detected, false otherwise.

Here is the call graph for this function:


The documentation for this class was generated from the following files: