added button state procedures

doesnt block to wait for switch bouncing to calm, but tracks
the state of the button using timing. this will allow ui elements
to detect when the switch is being held down and the encoder is
being rotated at the same time.