greem:
I'm in control of the square waves frequency by the PWM output, but I'm not generating it.
I'm not sure I understand that, but anyway you will probably find that interrupts will capture fast-changing edges better than pulseIn.
greem:
I'm in control of the square waves frequency by the PWM output, but I'm not generating it.
I'm not sure I understand that, but anyway you will probably find that interrupts will capture fast-changing edges better than pulseIn.