Problems tracking pin state with Switch statement

holmes4:
First auto format your code before YOU try to debug it.

Second look in the playground for button/switch debounce.

Mark

Hi, I don't think its a problem of reading too many pulses since there is already a debounce for reading in individual pulses thru debounceDelay and for adding a value after the dial has finished rotating thru dialHasFinishedRotatingAfterMs. I (think) the problem might be simply that the program might be missing pulses as it loops through the rest of the program. An entire pulse might happen between measurements and not be counted. I think this because rotating the dial longer makes it more likely to be measured and simply putting dial in a loop by itself fixes the problem. unfortunately I'd like to measure callstatus and detect dialing at the same time. or quickly enough that a change in either won't be missed.