17 #ifndef ROVERAPI_ROVER_HCSR04_HPP_ 18 #define ROVERAPI_ROVER_HCSR04_HPP_ int ROVERHCSR04_SETUP_
Flag to hold if RoverHCSR04 is set up.
Definition: rover_hcsr04.hpp:66
RoverSensor class is an abstract class to define interface between common sensors used in the rover...
Definition: rover_sensor.hpp:48
RoverSensorID_t sensorID
Sensor Identification.
Definition: rover_hcsr04.hpp:51
RoverSensorID_t
RoverSensorID_t defines the sensor location ID of the proximity sensors on the rover.
Definition: rover_sensor.hpp:38
int getTrigPin(void)
Returns the private attribute trigPin for HCSR04.
Definition: rover_hcsr04.cpp:117
static const int TRIG1
HC-SR04 Sensor Trigger Pin for Rear Sensor Socket (in wiringPi format)
Definition: rover_hcsr04.hpp:34
int trigPin
Trigger pin.
Definition: rover_hcsr04.hpp:56
void initialize(void)
Function to setup HCSR04 sensor.
Definition: rover_hcsr04.cpp:47
static const int ECHO1
HC-SR04 Sensor Echo Pin for Rear Sensor Socket (in wiringPi format)
Definition: rover_hcsr04.hpp:38
static const int TRIG0
HC-SR04 Sensor Trigger Pin for Front Sensor Socket (in wiringPi format)
Definition: rover_hcsr04.hpp:25
rover Namespace contains classes to manage Rover sensors, gpio, buzzer, buttons, driving, utilities, and cloud.
Definition: rover_api.hpp:293
int getEchoPin(void)
Returns the private attribute echoPin for HCSR04.
Definition: rover_hcsr04.cpp:127
void setEchoPin(const int echo_pin)
Sets the private attribute echoPin for HCSR04.
Definition: rover_hcsr04.cpp:122
RoverHCSR04 is a class that is inherited from RoverSensor abstract class. RoverHCSR04 class contains ...
Definition: rover_hcsr04.hpp:45
~RoverHCSR04()
Destructor for the RoverHCSR04 class.
Definition: rover_hcsr04.cpp:45
RoverHCSR04(const RoverSensorID_t sensor_id)
Constructor for the RoverHCSR04 class.
Definition: rover_hcsr04.cpp:22
float read(void)
Member function to read from HC-SR04 ultrasonic sensor given its sensor id.
Definition: rover_hcsr04.cpp:61
int echoPin
Echo pin.
Definition: rover_hcsr04.hpp:61
void setTrigPin(const int trig_pin)
Sets the private attribute trigPin for HCSR04.
Definition: rover_hcsr04.cpp:112
static const int ECHO0
HC-SR04 Sensor Echo Pin for Front Sensor Socket (in wiringPi format)
Definition: rover_hcsr04.hpp:29