EvoTriButton#
- class EvoTriButton(pin)#
Reads the Evo three-button analog input. The button IDs are
1for black,2for red and3for blue.- getButton(button=0)#
Read either the raw ADC value or the state of a selected button.
- Parameters:
button (int) –
0for raw ADC, or1to3for a button.- Returns:
Raw ADC integer when
buttonis0. For a selected button, returns1when pressed and0when not pressed.- Raises:
ValueError – If
buttonis outside0to3.
- getButtonPressed()#
Identify which button is currently pressed from the analog threshold.
- Returns:
1,2or3for the pressed button, or-1when 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.