Moved input and counter handling into ISR.

This now handles the 0.1 ms debounce correctly.
Also moved the ADC GO into the ISR to make it
less likely that the ADC gets interrupted.