rcute_cozmars.touch_sensor

class rcute_cozmars.touch_sensor.TouchSensor(robot)
when_touched = None

Callback function, called when the touch sensor is touched, the default is None

when_released = None

Callback function, called when the touch sensor is released, the default is None

when_long_touched = None

Callback function, called when the touch sensor is long touched, the default is None

when_double_touched = None

Callback function, called when the touch sensor is double-clicked, the default is None

double_touch_threshold

Interval threshold between two clicks to be recognized as a double touch, in seconds, default is 0.3

long_touch_repeat

Whether to allow repetitive call of when_long_touched, the default is False

If set to True, while the touch sensor is held down, when_long_touched will be called every long_touch_threshold

long_touch_threshold

The minimum time (in seconds) required to touch and hold the touch sensor before when_held is called, the default is 1.0

touched
double_touched
long_touched

Whether the touch sensor is being long touched