EV3TouchSensor#

class EV3TouchSensor(pin)#

Digital touch sensor helper for an EV3-style touch input.

getButton()#

Read the raw input level from the touch sensor pin.

Returns:

1 when the input is high, 0 when it is low.

isPressed()#

Check whether the touch sensor is currently pressed.

Returns:

Boolean True when pressed.

isReleased()#

Check whether the touch sensor is currently released.

Returns:

Boolean True when released.

waitForPress(debouncems=200)#

Block until the sensor is pressed, then wait for the debounce period.

Returns:

None.

waitForRelease(debouncems=200)#

Block until the sensor is released, then wait for the debounce period.

Returns:

None.

waitForBump(debouncems=200)#

Block until the sensor is pressed and released.

Returns:

None.