![]() |
Roboid Control for C++ 0.4
|
An HC-SR04 ultrasonic distance sensor.
#include <UltrasonicSensor.h>
Public Member Functions | |
| UltrasonicSensor (Configuration config, Thing *parent=Thing::LocalRoot()) | |
| float | GetDistance () |
| erform an ultrasonic 'ping' to determine the distance to the nearest object | |
| virtual void | Update (bool recursive=false) override |
Public Attributes | |
| float | distance = 0 |
| The distance at which the object is considered to be touched. | |
Protected Attributes | |
| unsigned char | pinTrigger = 0 |
| The pin number of the trigger signal. | |
| unsigned char | pinEcho = 0 |
| The pin number of the echo signal. | |
| float RoboidControl::Arduino::UltrasonicSensor::GetDistance | ( | ) |
erform an ultrasonic 'ping' to determine the distance to the nearest object
|
overridevirtual |
Reimplemented from RoboidControl::Thing.
| float RoboidControl::Arduino::UltrasonicSensor::distance = 0 |
The distance at which the object is considered to be touched.
The last read distance