Motor Control With Zero Crossing and Mode Select

tylernt:
Easy enough with a delay(2); statement (except you can't use delay() in an ISR). Not sure how that's better than leaving the pin HIGH the whole cycle though?

tylernt,

Your correct about letting the the whole pulse through. That's exactly what I did. For some reason I am still seeing the Outgoing signal walking compared to the incoming signal. If I can I'll grab a snap shot of the signals from the Scope today and post it.

Thanks for everyone's help!

Well one approach is to grab the value of millis() in your ISR and put it into a volatile unsigned long global variable. (millis() does not increment in an ISR, but you can grab a snapshot of it).

Then, in loop(), check to see if more than two milliseconds has passed compared to your volatile unsigned long variable (see the BlinkWithoutDelay example for that process), and if enough time has passed, digitalWrite() the pumpPin off.