RoboidControl for Arduino
Loading...
Searching...
No Matches
Thing.h
Go to the documentation of this file.
1#pragma once
2
3namespace Passer {
4namespace RoboidControl {
5
7class Thing {
8 public:
10 Thing();
11
13 unsigned int type;
14
15 static const unsigned int SwitchType;
16 static const unsigned int DistanceSensorType;
17 static const unsigned int ControlledMotorType;
18 static const unsigned int UncontrolledMotorType;
19
22 bool IsMotor();
25 bool IsSensor();
26
27 protected:
29 static const unsigned int MotorType = 0x8000;
31 static const unsigned int SensorType = 0x4000;
32
34 enum class Type {
36 // Sensor,
37 Switch,
39 // Motor,
42 };
43};
44
45} // namespace RoboidControl
46} // namespace Passer
47using namespace Passer::RoboidControl;
A thing is a functional component on a robot.
Definition Thing.h:7
static const unsigned int DistanceSensorType
Definition Thing.h:16
bool IsSensor()
Check if the Thing is a Sensor.
Definition Thing.cpp:21
static const unsigned int MotorType
Bitmask for Motor type.
Definition Thing.h:29
bool IsMotor()
Check if the Thing is a Motor.
Definition Thing.cpp:17
Thing()
Default constructor for a Thing.
Definition Thing.cpp:5
static const unsigned int ControlledMotorType
Definition Thing.h:17
static const unsigned int UncontrolledMotorType
Definition Thing.h:18
unsigned int type
The type of Thing.
Definition Thing.h:13
static const unsigned int SensorType
Bitmap for Sensor type.
Definition Thing.h:31
static const unsigned int SwitchType
Definition Thing.h:15
Type
Basic Thing types.
Definition Thing.h:34
Definition DRV8833.h:7
Definition DRV8833.h:6