Skip to content

Built-in board buttons

ESP:BIT (esp_bit_button)

What it does: Returns the state of the button selected by the A/B menu. The generator uses A on GPIO5 and B on GPIO6 and returns the digital input value directly.

esp_bit_button

Pico:ed (pico_ed_button)

What it does: Returns the state of the selected A/B button. A is on GPIO20, B on GPIO21. The generator inverts the pin value (not Pin.value()) so that the active low corresponds to a true result.

pico_ed_button

Inputs, output and usage

Both blocks only have button selection and value output. Plug them into condition if. They read the current status; while holding the button, the condition will apply in each pass of the loop. For a single click action, compare the current and previous state in a variable.

The fixed pins and polarity correspond to the given type of board. For a custom button on another pin, use digital input and the appropriate input initialization.