Reflective IR Unit

Support the following products:

Reflective IR Unit

class ReflectiveIRUnit

Constructors

class ReflectiveIRUnit(port: tuple)

Create a ReflectiveIRUnit object.

Parameters:

port (tuple) – Specify the port to which the Reflective IR Unit is connected.

UIFLOW2:

init.svg

Methods

ReflectiveIRUnit.get_analog_value() int

This method allows read the ADC value of the Reflective IR Unit and return an integer value. The value ranges from 0 to 65535.

UIFLOW2:

get_analog_value.svg

ReflectiveIRUnit.get_digital_value() int

This method allows read the digital value of the Reflective IR Unit and return an integer value. The value ranges from 0 to 1.

UIFLOW2:

get_digital_value.svg

ReflectiveIRUnit.enable_irq() None

Enable Obstacle detection event

UIFLOW2:

enable_irq.svg

ReflectiveIRUnit.disable_irq() None

Disable Obstacle detection event

UIFLOW2:

disable_irq.svg

ReflectiveIRUnit.set_callback(handler, trigger=ReflectiveIRUnit.EVENT_DETECTED | ReflectiveIRUnit.EVENT_NOT_DETECTED) None

Set the callback function for the Reflective IR Unit.

Parameters:
  • handler – The callback function to be set.

  • trigger – The trigger condition for the callback function.

UIFLOW2:

set_callback.svg

Constants

ReflectiveIRUnit.EVENT_DETECTED
ReflectiveIRUnit.EVENT_NOT_DETECTED

select the EVENT type of the Reflective IR Unit.