upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|
API for the RPR220-based Grove IR Reflective Sensor. More...
UPM module for the Grove IR reflective sensor. The sensitivity can be adjusted with the potentiometer on the sensor module. It has a range of approximately 15 mm, and a quick response time.
It detects high-contrast dark areas on a light background.
This module allows the user to determine the current status (black detected or not). Additionally, if desired, an interrupt service routine (ISR) can be installed that is called when black is detected. Either method can be used, depending on your use case.
Public Member Functions | |
RPR220 (int pin) | |
~RPR220 () | |
bool | blackDetected () |
void | installISR (void(*isr)(void *), void *arg) |
void | uninstallISR () |
bool blackDetected | ( | ) |
Gets the status of the pin; true means black has been detected
void installISR | ( | void(*)(void *) | isr, |
void * | arg | ||
) |
Installs an ISR to be called when black is detected
isr | Pointer to a function to be called on interrupt |
arg | Pointer to an object to be supplied as an argument to the ISR. |
void uninstallISR | ( | ) |
Uninstalls the previously installed ISR