[−][src]Trait rmicrobit::buttons::core::PollButton
A button which can be polled.
A PollButton
keeps track of its state (pressed or released), updating it
when a poll_
method is called.
The poll_transition()
and poll_event()
methods have the same effects
and return equivalent information; you can use whichever form is more
convenient.
The states reported may have had a debouncing algorithm applied to what the underlying device reports.
Required methods
fn is_pressed(&self) -> bool
Reports whether the button was in pressed state when last polled.
fn poll_transition(&mut self) -> Transition
Polls the button and indicates its previous and current state.
The underlying button is read at this point.
Provided methods
fn poll_event(&mut self) -> Option<TransitionEvent>
Polls the button and indicates any change in state.
The underlying button is read at this point.