SimpleFOClibrary  2.1
Sensor.h
Go to the documentation of this file.
1 #ifndef SENSOR_H
2 #define SENSOR_H
3 
7 enum Direction{
8  CW = 1, //clockwise
9  CCW = -1, // counter clockwise
10  UNKNOWN = 0 //not yet known or invalid state
11 };
12 
13 
17 enum Pullup{
19  EXTERN
20 };
21 
26 class Sensor{
27  public:
28 
30  virtual float getAngle()=0;
32  virtual float getVelocity();
33 
39  virtual int needsSearch();
40  private:
41  // velocity calculation variables
42  float angle_prev=0;
43  long velocity_calc_timestamp=0;
44 };
45 
46 #endif
CW
@ CW
Definition: Sensor.h:8
Sensor::needsSearch
virtual int needsSearch()
Definition: Sensor.cpp:10
UNKNOWN
@ UNKNOWN
Definition: Sensor.h:10
INTERN
@ INTERN
Use internal pullups.
Definition: Sensor.h:18
Sensor::getVelocity
virtual float getVelocity()
Definition: Sensor.cpp:15
EXTERN
@ EXTERN
Use external pullups.
Definition: Sensor.h:19
Pullup
Pullup
Definition: Sensor.h:17
CCW
@ CCW
Definition: Sensor.h:9
Direction
Direction
Definition: Sensor.h:7
Sensor::getAngle
virtual float getAngle()=0
Sensor
Definition: Sensor.h:26