EvoTriButton#

class EvoTriButton(pin)#

Reads the Evo three-button analog input. The button IDs are 1 for black, 2 for red and 3 for blue.

getButton(button=0)#

Read either the raw ADC value or the state of a selected button.

Parameters:

button (int) – 0 for raw ADC, or 1 to 3 for a button.

Returns:

Raw ADC integer when button is 0. For a selected button, returns 1 when pressed and 0 when not pressed.

Raises:

ValueError – If button is outside 0 to 3.

getButtonPressed()#

Identify which button is currently pressed from the analog threshold.

Returns:

1, 2 or 3 for the pressed button, or -1 when no button threshold matches.

waitForPress(button, debouncems=200)#

Block until the requested button is pressed.

Returns:

None.

waitForRelease(debouncems=200)#

Block until all buttons are released.

Returns:

None.

waitForBump(button, debouncems=200)#

Block until the requested button is pressed and then released.

Returns:

None.