#include <Ultrasonic.h>
Ultrasonic object class
Class to easily interact with the ultrasonic sensor written by Wade Varesio 9/14/2018
Ultrasonic::Ultrasonic |
( |
byte |
trigger, |
|
|
byte |
echo |
|
) |
| |
|
inline |
Contructs an Ultrasonic object
- Parameters
-
trigger | the pin that the ultrasonic trigger pin is associated with. |
echo | the pin that the ultrasonic echo pin is associated with. |
void Ultrasonic::startMeasurement |
( |
| ) |
|
|
inline |
Starts a measurement on the ultrasonic sensor.
Start a measurement by clearing the trigger pin, then setting to high and reading from the echoPin
int Ultrasonic::getDistanceInCM |
( |
| ) |
|
|
inline |
Return distance from the ultrasonic sensor in CM
- Returns
- the distance of the object from the ultrasonic sensor in CM
float Ultrasonic::getDistanceInInches |
( |
| ) |
|
|
inline |
Return the distance in inches
- Returns
- the distance of the object from the ultrasonic sensor in inches
bool Ultrasonic::inProgress |
( |
| ) |
|
|
inline |
Checks if the ultrasonic sensor is in porgress (taking a measurement)
- Returns
- If the ultrasonic sensor is runnning a measurment.
The documentation for this class was generated from the following file: