|
RSeries astromech firmware
|
|
Go to the documentation of this file. 1 #ifndef DomeSensorRingSerialListener_h
2 #define DomeSensorRingSerialListener_h
9 #ifndef DOMESENSOR_BAUD_RATE
10 #define DOMESENSOR_BAUD_RATE 57600
13 #ifdef USE_DOME_SENSOR_SERIAL_DEBUG
14 #define DOME_SENSOR_SERIAL_PRINT(s) DEBUG_PRINT(s)
15 #define DOME_SENSOR_SERIAL_PRINTLN(s) DEBUG_PRINTLN(s)
16 #define DOME_SENSOR_SERIAL_PRINT_HEX(s) DEBUG_PRINT_HEX(s)
17 #define DOME_SENSOR_SERIAL_PRINTLN_HEX(s) DEBUG_PRINTLN_HEX(s)
19 #define DOME_SENSOR_SERIAL_PRINT(s)
20 #define DOME_SENSOR_SERIAL_PRINTLN(s)
21 #define DOME_SENSOR_SERIAL_PRINT_HEX(s)
22 #define DOME_SENSOR_SERIAL_PRINTLN_HEX(s)
40 return (fPosition != -1);
51 while (fStream->available())
53 int ch = fStream->read();
54 if (ch ==
'\r' || ch ==
'\n')
68 fPosition = fSamples.
median();
74 if (fStream->available() < 10)
87 fState = (ch ==
'#') ? fState+1 : -1;
90 fState = (ch ==
'D') ? fState+1 : -1;
93 fState = (ch ==
'P') ? fState+1 : -1;
96 fState = (ch ==
'@') ? fState+1 : -1;
100 if (ch >=
'0' && ch <=
'9')
102 fValue = fValue * 10 + (ch -
'0');
124 int fSampleCount = 0;
125 unsigned fErrorCount = 0;
virtual int getAngle() override
Definition: DomeSensorRingSerialListener.h:43
Base class for all animated devices. AnimatedEvent::animate() is called for each device once through ...
Definition: AnimatedEvent.h:18
virtual void animate() override
Subclasses must implement this function to run through a single frame of animation/activity.
Definition: DomeSensorRingSerialListener.h:48
#define DOME_SENSOR_SERIAL_PRINT(s)
Definition: DomeSensorRingSerialListener.h:19
Definition: DomeSensorRingSerialListener.h:25
#define DEBUG_PRINTLN(s)
Definition: ReelTwo.h:188
Definition: DomePositionProvider.h:4
unsigned getErrorCount()
Definition: DomeSensorRingSerialListener.h:33
#define DOME_SENSOR_SERIAL_PRINTLN(s)
Definition: DomeSensorRingSerialListener.h:20
virtual bool ready() override
Definition: DomeSensorRingSerialListener.h:38
DomeSensorRingSerialListener(Stream &serial)
Definition: DomeSensorRingSerialListener.h:28