|
Simple_HCSR04
A simple wrapper for the HC-SR04 Module to be used for e.g. an Arduino.
|
A simple wrapper for measuring the distance with an HC-SR04 Module. More...
#include <Simple_HCSR04.h>
Classes | |
| class | Measurement |
| A simple wrapper for holding the measured distance. More... | |
Public Member Functions | |
| Simple_HCSR04 (const short echo_pin, const short trig_pin) | |
| Construct a new Simple_HCSR04::Simple_HCSR04 object and initializes the pin mode for the given pins. More... | |
| short | getEchoPin () const |
| Getter for the Echo pin. More... | |
| short | getTrigPin () const |
| Getter for the Trig pin. More... | |
| Measurement * | measure () |
| Measures the distance between the module and the object in front of it. Warning: this function needs at least 12 milliseconds to execute. More... | |
A simple wrapper for measuring the distance with an HC-SR04 Module.
| Simple_HCSR04::Simple_HCSR04 | ( | const short | echo_pin, |
| const short | trig_pin | ||
| ) |
Construct a new Simple_HCSR04::Simple_HCSR04 object and initializes the pin mode for the given pins.
| echo_pin | Echo pin on the microcontroller (warning, is being cast to an unsigned short). |
| trig_pin | Trig pin on the microcontroller (warning, is being cast to an unsigned short). |
| short Simple_HCSR04::getEchoPin | ( | ) | const |
Getter for the Echo pin.
| short Simple_HCSR04::getTrigPin | ( | ) | const |
Getter for the Trig pin.
| Simple_HCSR04::Measurement * Simple_HCSR04::measure | ( | ) |
Measures the distance between the module and the object in front of it. Warning: this function needs at least 12 milliseconds to execute.
1.8.17