Categories
Computing

Hello Button

An important goal for Yarg is to make interrupt handling ‘just code’, readable and writable with the same language as the rest of the program. A straightforward example is responding to a button press.

This simple sounding act will become more complex in future versions, as it will be important to support ‘debouncing’ of the button in software. Skipping that for now, ‘hello_button.ya‘ uses a circuit with a Pico to light an LED when a button is pressed. Hold the button down to keep the LED illuminated.

The circuit needed:

Connected to GPIO 12 is an LED and a 220ohm resistor. Connected to GPIO11 is a tactile pushbutton.