upm  0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
Public Member Functions | List of all members

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 (true) {
boolean val = finder.whiteDetected();
if (val) {
System.out.println("White detected");
} else {
System.out.println("Black detected");
}
Thread.sleep(1000);
}

Public Member Functions

synchronized void delete ()
 
 GroveLineFinder (int pin)
 
boolean whiteDetected ()
 
boolean blackDetected ()
 

Constructor & Destructor Documentation

GroveLineFinder ( int  pin)

Grove Line Finder digital sensor constructor

Parameters
pinDigital pin to use

Member Function Documentation

boolean blackDetected ( )

Determines whether black has been detected

Returns
True if black is detected
boolean whiteDetected ( )

Determines whether white has been detected

Returns
True if white is detected

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