RoboidControl for Arduino
Loading...
Searching...
No Matches
DistanceSensor.h
Go to the documentation of this file.
1#pragma once
2
3#include "Sensor.h"
4
5namespace Passer {
6namespace RoboidControl {
7
9class DistanceSensor : public Sensor {
10 public:
17
20 virtual float GetDistance();
21
23 float triggerDistance = 1;
24
27 bool IsOn();
28
29 protected:
31 float distance = 0;
32};
33
34} // namespace RoboidControl
35} // namespace Passer
36using namespace Passer::RoboidControl;
A Sensor which can measure the distance to the nearest object.
Definition DistanceSensor.h:9
DistanceSensor()
Default constructor.
Definition DistanceSensor.cpp:3
float distance
Distance to the closest object.
Definition DistanceSensor.h:31
float triggerDistance
The distance at which ObjectNearby triggers.
Definition DistanceSensor.h:23
bool IsOn()
Indicate that an object is nearby.
Definition DistanceSensor.cpp:15
virtual float GetDistance()
Determine the distance to the nearest object.
Definition DistanceSensor.cpp:11
A sensor is a thing which can perform measurements in the environment.
Definition Sensor.h:9
Definition DRV8833.h:7
Definition DRV8833.h:6