forked from ksya/ILIFERobot
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Structs.h
44 lines (39 loc) · 1.01 KB
/
Structs.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
typedef struct IRbutton {
const char* name;
unsigned int signal[67];
} IRbutton;
typedef struct IRbutton_long {
const char* name;
unsigned int signal[99];
} IRbutton_long;
typedef struct PinTime {
int pin;
unsigned long high = 0;
unsigned long low = 0;
unsigned long lastPinHigh = 0;
unsigned long lastPinLow = 0;
int lastValue = -1;
boolean isHigh = false;
boolean isLow = false;
boolean isBlinking = false;
float ratio = 0;
boolean changed = false;
boolean statusChanged = false;
unsigned int valueBuffer[512]; //used to calculate average
size_t bufferSize; //total buffer size, used to calculate average
size_t valn = 0; //position in buffer, used to calculate average
} pinTime;
typedef struct Battery {
float voltageBuffer[8] = {0,0,0};
size_t bufferSize = 8; //total buffer size, used to calculate average
size_t valn = 0; //position in buffer, used to calculate average
} battery;
enum Status {
S_BOOTING,
S_SLEEP,
S_IDLE,
S_BUSY,
S_STUCK,
S_DOCKED,
S_GOING_HOME
};