RPR220 Class
- ID: rpr220
- Name: Infrared (IR) Reflective Sensor
- Other Names: Grove IR Reflective Sensor
- Category: light
- Manufacturer: seeed
- Link: http://www.seeedstudio.com/wiki/Grove_-_Infrared_Reflective_Sensor
- Connection: gpio
- Kit: tsk hak
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.
Item Index
Methods
Methods
RPR220
-
pin
RPR220 constructor
Parameters:
-
pin
NumberDigital pin to use
Returns:
blackDetected
()
Boolean
Gets the status of the pin; true means black has been detected
Returns:
True if the sensor has detected black
installISR
-
isr
-
arg
Installs an ISR to be called when black is detected
Parameters:
-
isr
FunctionPointer to a function to be called on interrupt
-
arg
Void *Pointer to an object to be supplied as an argument to the ISR.
uninstallISR
()
Uninstalls the previously installed ISR