|
upm
0.4.1
Sensor/Actuator repository for libmraa (v0.8.0)
|
API for the HC-SR04 Ultrasonic Sensor. More...
This module defines the HC-SR04 interface for libhcsr04
Public Member Functions | |
| synchronized void | delete () |
| HCSR04 (short triggerPin, short echoPin) | |
| double | getDistance (int sys) |
| void | setM_doWork (short value) |
| short | getM_doWork () |
| String | name () |
| HCSR04 | ( | short | triggerPin, |
| short | echoPin | ||
| ) |
Instantiates an HCSR04 object
| triggerPin | Pin to trigger the sensor for distance |
| echoPin | Pulse response to triggering |
| fptr | Function pointer to handle rising-edge and falling-edge interrupts |
| double getDistance | ( | int | sys | ) |
Gets the distance from the sensor
| short getM_doWork | ( | ) |
Flag to control blocking function while waiting for a falling-edge interrupt
| String name | ( | ) |
Returns the name of the sensor
1.8.9.1