INF2004-Project v0.1
 
Loading...
Searching...
No Matches
Ultrasonic macros

Macros for the ultrasonic sensor. More...

Macros

#define ULTRASONIC_PULSE_TO_CM(x)   (x / 29. / 2.)
 
#define ULTRASONIC_PULSE_TO_IN(x)   (x / 74. / 2.)
 

Detailed Description

Macros for the ultrasonic sensor.

Macro Definition Documentation

◆ ULTRASONIC_PULSE_TO_CM

#define ULTRASONIC_PULSE_TO_CM (   x)    (x / 29. / 2.)
Parameters
[in]xPulse width in us. Constants from datasheet.
Returns
Pulse width in cm.

◆ ULTRASONIC_PULSE_TO_IN

#define ULTRASONIC_PULSE_TO_IN (   x)    (x / 74. / 2.)
Parameters
[in]xPulse width in us. Constants from datasheet.
Returns
Pulse width in inches.