Is there a simple way to decipher the pulse width of an incoming PWM signal?
Would I use Pulsein() and measure the time between positive and negative going waveforms, or is there a better/simpler way.
Is there a simple way to decipher the pulse width of an incoming PWM signal?
Would I use Pulsein() and measure the time between positive and negative going waveforms, or is there a better/simpler way.
Either use pulseIn()
or set up an interrupt to record the time when the pulse rises and falls. pulseIn()
is easier if it is fast enough.
...R