pyupm_rpr220 module

class pyupm_rpr220.RPR220(pin)[source]

Bases: object

API for the RPR220-based Grove IR Reflective Sensor.

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.

C++ includes: rpr220.hpp

blackDetected()[source]

bool blackDetected()

Gets the status of the pin; true means black has been detected

True if the sensor has detected black

installISR(isr, arg)[source]

void installISR(void(*isr)(void *), 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.

uninstallISR()[source]

void uninstallISR()

Uninstalls the previously installed ISR