A Sensor which can measure the distance to the nearest object.
More...
#include <DistanceSensor.h>
|
float | distance = 0 |
| Distance to the closest object.
|
|
A Sensor which can measure the distance to the nearest object.
◆ Type
Basic Thing types.
Enumerator |
---|
Undetermined | |
Switch | |
DistanceSensor | |
ControlledMotor | |
UncontrolledMotor | |
◆ DistanceSensor() [1/2]
DistanceSensor::DistanceSensor |
( |
| ) |
|
◆ DistanceSensor() [2/2]
DistanceSensor::DistanceSensor |
( |
float |
triggerDistance | ) |
|
Creates a DistanceSensor with the given trigger distance.
- Parameters
-
triggerDistance | The distance at which the sensors indicates that a object is close by |
◆ GetDistance()
float DistanceSensor::GetDistance |
( |
| ) |
|
|
virtual |
◆ IsOn()
bool DistanceSensor::IsOn |
( |
| ) |
|
Indicate that an object is nearby.
- Returns
- True when an object is nearby
◆ IsMotor()
◆ IsSensor()
◆ triggerDistance
float Passer::RoboidControl::DistanceSensor::triggerDistance = 1 |
The distance at which ObjectNearby triggers.
◆ distance
float Passer::RoboidControl::DistanceSensor::distance = 0 |
|
protected |
Distance to the closest object.
◆ type
unsigned int Passer::RoboidControl::Thing::type |
|
inherited |
◆ SwitchType
◆ DistanceSensorType
const unsigned int Thing::DistanceSensorType |
|
staticinherited |
Initial value:=
static const unsigned int SensorType
Bitmap for Sensor type.
Definition Thing.h:31
◆ ControlledMotorType
const unsigned int Thing::ControlledMotorType |
|
staticinherited |
Initial value:=
static const unsigned int MotorType
Bitmask for Motor type.
Definition Thing.h:29
◆ UncontrolledMotorType
const unsigned int Thing::UncontrolledMotorType |
|
staticinherited |
◆ MotorType
const unsigned int Passer::RoboidControl::Thing::MotorType = 0x8000 |
|
staticprotectedinherited |
◆ SensorType
const unsigned int Passer::RoboidControl::Thing::SensorType = 0x4000 |
|
staticprotectedinherited |
The documentation for this class was generated from the following files: