upm  0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
 All Data Structures Files Functions Variables 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.

rfr359f.jpg
// 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;
else
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

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: