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

API for the RFR359F-based Grove Distance Interrupter. More...

Detailed Description

UPM module for the Grove distance interrupter. The sensitivity can be adjusted with the potentiometer on the sensor module. It has a range of approximately 4 inches and a quick response time.

rfr359f.jpg
// Instantiate an RFR359F digital pin D2
// This was tested on the Grove IR Distance Interrupter
upm::RFR359F dInterruptor(2);
// The range appears to be about 4 inches, depending on adjustment
while (shouldRun) {
if (dInterruptor.objectDetected())
cout << "Object detected" << endl;
else
cout << "Area is clear" << endl;
upm_delay_us(100000); // 100ms
}

Public Member Functions

 RFR359F (int pin)
 
 ~RFR359F ()
 
bool objectDetected ()
 

Constructor & Destructor Documentation

RFR359F ( int  pin)

RFR359F constructor

Parameters
pinDigital pin to use
~RFR359F ( )

RFR359F destructor

Member Function Documentation

bool objectDetected ( )

Gets the status of the pin; true means an object has been detected

Returns
True if the sensor has detected an object

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