A mechanical pushbutton is connected to a microcontroller input. Write a software debouncing routine to ensure only one transition is registered per press.