nrf-rs / microbit

A Rust crate for BBC micro:bit development
BSD Zero Clause License
276 stars 61 forks source link

Interrupt on button example #12

Closed n-k closed 5 years ago

n-k commented 5 years ago

Is it possible to use interrupts to handle button events, instead of polling the buttons' state? It would be great if there was an example showing how to do that.

therealprof commented 5 years ago

@n-k Indeed. The gpio_hal_printbuttons uses interrupts to detect button presses. Is that sufficient?

n-k commented 5 years ago

That's perfect @therealprof , I should have read the examples more closely.