Middlesex County, Ontario | A PWM input sends the distance out in a pulse. The distance measured by the sensor is represented by the length of the pulse. From the sensor manual:
Pin 2- Pulse Width Output: This pin outputs a pulse width representation of the distance with a scale factor of 1uS per
mm. The pulse width output is sent with a value within 0.5% of the serial output.
You would connect this to a digital input pin and measure how long the signal stays high for. You would not use a capacitor or an analog input pin. Example, the pulse stays high for 1000 microseconds (1 milliseconds) when the sensor distance is 1000 millimeters (1 meter).
Edited by WildBuckwheat 6/13/2019 20:35
|