![]() |
MatrixMiniR4 1.1.9
Matrix Mini R4 Arduino Library API Documentation
|
Class for controlling the HC-SR04 ultrasonic sensor. More...
#include <MiniR4HC04.h>
Public Member Functions | |
| MiniR4HC04 () | |
| float | getDistance (void) |
| Measures the distance using the HC-SR04 sensor. | |
Class for controlling the HC-SR04 ultrasonic sensor.
This template class provides methods for using the HC-SR04 ultrasonic sensor to measure distance using specified trigger and echo pins.
| PIN1 | (Left) The pin number for the trigger signal. |
| PIN2 | (Right) The pin number for the echo signal. |
Definition at line 21 of file MiniR4HC04.h.
|
inline |
Definition at line 24 of file MiniR4HC04.h.
|
inline |
Measures the distance using the HC-SR04 sensor.
Sends a trigger pulse and reads the echo response to calculate the distance in centimeters.
Definition at line 38 of file MiniR4HC04.h.