![]() |
ME507 Airheads Project v1.1.0
Flight Stabilization for Glider
|
Class for an HC_SR04 Ultrasonic Sensor. More...
#include <ultrasonic.h>
Public Member Functions | |
| Ultrasonic (uint8_t echoPin, uint8_t trigPin) | |
| Constructor for the ultrasonic sensor class. More... | |
| float | get_distance (void) |
| The method to get the distance measured from the ultrasonic sensor. More... | |
Class for an HC_SR04 Ultrasonic Sensor.
| Ultrasonic::Ultrasonic | ( | uint8_t | echo, |
| uint8_t | trig | ||
| ) |
Constructor for the ultrasonic sensor class.
Constructor which creates an ultrasonic sensor object.
| echo | The GPIO pin used to measure the time between ultrasonic pulses |
| trig | The GPIO pin used to send out ultrasonic pulses |
| float Ultrasonic::get_distance | ( | void | ) |
The method to get the distance measured from the ultrasonic sensor.
Measure the distance between the sensor and the object in front of it.