RoverHCSR04 is a class that is inherited from RoverSensor abstract class. RoverHCSR04 class contains member functions and variables to set up and read from HCSR-04 ultrasonic sensors that are embedded on the rover.
More...
#include <rover_hcsr04.hpp>
RoverHCSR04 is a class that is inherited from RoverSensor abstract class. RoverHCSR04 class contains member functions and variables to set up and read from HCSR-04 ultrasonic sensors that are embedded on the rover.
Constructor for the RoverHCSR04 class.
- Parameters
-
sensor_id | Sensor to address |
rover::RoverHCSR04::~RoverHCSR04 |
( |
| ) |
|
int rover::RoverHCSR04::getEchoPin |
( |
void |
| ) |
|
Returns the private attribute echoPin for HCSR04.
- Returns
- echo_pin Pin in wiringPi format for HCSR04
int rover::RoverHCSR04::getTrigPin |
( |
void |
| ) |
|
Returns the private attribute trigPin for HCSR04.
- Returns
- trig_pin Pin in wiringPi format for HCSR04
void rover::RoverHCSR04::initialize |
( |
void |
| ) |
|
|
virtual |
float rover::RoverHCSR04::read |
( |
void |
| ) |
|
|
virtual |
Member function to read from HC-SR04 ultrasonic sensor given its sensor id.
- Returns
- sensor_val Sensor value read in centimeters from sensor
Implements rover::RoverSensor.
void rover::RoverHCSR04::setEchoPin |
( |
const int |
echo_pin | ) |
|
Sets the private attribute echoPin for HCSR04.
- Parameters
-
echo_pin | Pin in wiringPi format for HCSR04 |
- Returns
- void
void rover::RoverHCSR04::setTrigPin |
( |
const int |
trig_pin | ) |
|
Sets the private attribute trigPin for HCSR04.
- Parameters
-
trig_pin | Pin in wiringPi format for HCSR04 |
- Returns
- void
int rover::RoverHCSR04::echoPin |
|
private |
int rover::RoverHCSR04::ROVERHCSR04_SETUP_ |
|
private |
int rover::RoverHCSR04::trigPin |
|
private |
The documentation for this class was generated from the following files: