-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisionState.h
More file actions
35 lines (31 loc) · 888 Bytes
/
VisionState.h
File metadata and controls
35 lines (31 loc) · 888 Bytes
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
#ifndef VisionState_h
#define VisionState_h
#include "Arduino.h"
#include <elapsedMillis.h>
#define STATE_STOP -1
#define STATE_WAIT -2
#define STATE_WAIT_MICROS -3
#define STATE_WAIT_FOR -4
#define STATE_NEXT -5
#define STATE_LAST -6
#define STATE_NET -7
#define STATE_PATROL 500
class VisionState {
public:
void wait(unsigned long timeInMs, int nextState);
void waitMicros(unsigned long timeInMicros, int nextState);
void waitFor(boolean (*functionToTestFor)(), int nextState);
void doLoop();
operator int();
int operator =(const int state);
VisionState& operator+=(const int val);
VisionState& operator++();
VisionState operator++(int);
public:
int state, stateToSetAfterWait, originalState;
unsigned long timeToWait, timeToWaitInMicros;
elapsedMillis time;
elapsedMicros timeMicros;
boolean (*testFunction)();
};
#endif