upm  1.3.0
Sensor/Actuator repository for libmraa (v1.7.0)
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Public Member Functions
RFR359F Class Reference

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.

// Instantiate an RFR359F digital pin D2
// This was tested on the Grove IR Distance Interrupter
upm::RFR359F* dInterruptor = new upm::RFR359F(2);
// The range appears to be about 4 inches, depending on adjustment
while (shouldRun)
if (dInterruptor->objectDetected())
cout << "Object detected" << endl;
cout << "Area is clear" << endl;
usleep(100000); // 100ms

Public Member Functions

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

Constructor & Destructor Documentation

RFR359F ( int  pin)

RFR359F constructor

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

True if the sensor has detected an object

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