upm
0.5.1
Sensor/Actuator repository for libmraa (v0.9.1)
|
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
fptr | 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