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

API for the Line Finder Sensor. More...

Detailed Description

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

// Instantiate a Line Finder sensor on digital pin D2
upm::LineFinder* finder = new upm::LineFinder(2);
// check every second for the presence of white detection
while (shouldRun)
bool val = finder->whiteDetected();
if (val)
cout << "White detected." << endl;
cout << "Black detected." << endl;

Public Member Functions

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

Constructor & Destructor Documentation

LineFinder ( int  pin)

Line Finder digital sensor constructor

pinDigital pin to use
~LineFinder ( )

LineFinder destructor

Member Function Documentation

bool whiteDetected ( )

Determines whether white has been detected

True if white is detected
bool blackDetected ( )

Determines whether black has been detected

True if black is detected

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