|
upm
1.7.1
Sensor/Actuator repository for libmraa (v2.0.0)
|

Go to the source code of this file.
Data Structures | |
| struct | _hcsr04_context |
Functions | |
| hcsr04_context | hcsr04_init (int triggerPin, int echoPin) |
| void | hcsr04_close (hcsr04_context dev) |
| double | hcsr04_get_distance (hcsr04_context dev, HCSR04_U unit) |
Typedefs | |
| typedef struct _hcsr04_context * | hcsr04_context |
Enumerations | |
| enum | HCSR04_U { HCSR04_CM = 0, HCSR04_INCH } |
| hcsr04_context hcsr04_init | ( | int | triggerPin, |
| int | echoPin | ||
| ) |
HCSR04 Initialization function
| triggerPin | GPIO pin for trigger |
| echoPin | GPIO pin used for output from sensor |
| void hcsr04_close | ( | hcsr04_context | dev | ) |
HCSR04 Close function
| dev | hcsr04_context pointer |

| double hcsr04_get_distance | ( | hcsr04_context | dev, |
| HCSR04_U | unit | ||
| ) |
Function to get the distance from the HCSR04 sensor
| unit | cm/inches |

1.8.11