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
GroveLineFinder Class Reference

API for the Grove Line Finder Sensor. More...

Detailed Description

UPM module for the Grove Line Finder sensor. It outputs a digital signal indicating whether it is detecting black on a white background, or white on a black background.

grovelinefinder.jpg
// Instantiate a Grove Line Finder sensor on digital pin D2
// check every second for the presence of white detection
while (shouldRun)
{
bool val = finder->whiteDetected();
if (val)
cout << "White detected." << endl;
else
cout << "Black detected." << endl;
sleep(1);
}

Public Member Functions

 GroveLineFinder (int pin)
 
 ~GroveLineFinder ()
 
bool whiteDetected ()
 
bool blackDetected ()
 

Constructor & Destructor Documentation

GroveLineFinder ( int  pin)

Grove Line Finder digital sensor constructor

Parameters
pinDigital pin to use

GroveLineFinder destructor

Member Function Documentation

bool whiteDetected ( )

Determines whether white has been detected

Returns
True if white is detected
bool blackDetected ( )

Determines whether black has been detected

Returns
True if black is detected

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