With no screen and no keypad, we have to make do with the buttons and LEDs.
The ui_utils module gives you the ability to enter data at program run-time. This can reduce the number of times you have to edit and re-download your program. This is especially handy if you are running your CodeBot untethered.
Treating “both buttons are pressed” as a special case gives us a virtual 3rd button.
Returns which button is currently pressed, as one of the UI_BUTTON_xxx codes.
Allows a value to be adjusted, or kept as-is:
Press BTN-1 to raise the value.
Press BTN-0 to lower the value.
Press BOTH buttons at the same time to lock-in your choice.
Flashes the final value on the LEDs so you can tell what you entered.
Parameters: initial_value (int) – the value to start at.
Wait until the specified button is pressed.
Parameters: requested_ui_button (int) – the UI_BUTTON_XXX combination to wait for