millis() and micros() instead of delay.

A pulse is usually defined by two transitions, not one.