hc-sr04-ultrasonic-range

xod/common-hardware/hc-sr04-ultrasonic-range

Measures distance with HC-SR04 ultrasonic range meter. Keeps output intact if a ping fails (no echo or wrong connection).
hc-sr04-ultrasonic-range
@/hc-sr04-ultrasonic-range
Measures distance with HC-SR04 ultrasonic range meter. Keeps output intact if a ping fails (no echo or wrong connection).
TRIGport
Board port to which sensor’s `trig` pin is connected.
ECHOport
Board port to which sensor’s `echo` pin is connected.
PINGpulse
Triggers new ultrasonic ping which would result in the output update once sound echo will be captured. Pulses coming within 60 ms window after last one are ignored to fight sensor’s PCB resonance.
hc-sr04-ultrasonic-range
DmDmDONEDONEERRERRTRIGTRIGECHOECHOPINGPING
ERRpulse
Fires if ping failed
DONEpulse
Fires when ping is done
Dmnumber
Last measured distance in meters.