-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathDFW.h
More file actions
74 lines (71 loc) · 1.53 KB
/
Copy pathDFW.h
File metadata and controls
74 lines (71 loc) · 1.53 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
/**
* Serial controller library for DFWireless controllers
* For RBE Class use
* @author Joe St. Germain joest@wpi.edu
* @author Alex Taglieri (atags22)
* @author Kevin Harrington (madhephaestus)
*/
//written by Joe St. Germain
//
//
//
#ifndef DFW_h
#define DFW_h
#include "Arduino.h"
#include "AbstractDFWRobot.h"
#define autoTime 20000
#define teleopTime 120000
#define functionReturnTime 100
enum CompetitionState {
powerup, waitForAuto, Autonomous,waitForTeleop, Teleop
};
#define Null 0
#define buttonBytes 2
#define analogBytes 4
#define packetSize 15
class DFW {
public:
DFW(AbstractDFWRobot * myrobot);
DFW(int debugpin);
void begin();
void run();
int joystickrv(void);
int joystickrh(void);
int joysticklv(void);
int joysticklh(void);
bool start(void);
bool select(void);
bool one(void);
bool two(void);
bool three(void);
bool four(void);
bool up(void);
bool down(void);
bool left(void);
bool right(void);
bool l1(void);
bool l2(void);
bool r1(void);
bool r2(void);
bool jr(void);
bool jl(void);
void end(void);
CompetitionState getCompetitionState(void);
private:
void startup();
AbstractDFWRobot * robot;
void update(void);
long autoStartTime;
long teleopStartTime;
CompetitionState state;
int packet[packetSize];
int byteAn[analogBytes];
int byteBu[buttonBytes];
long lastHeartBeatTime;
long hbTime;
long flashTime;
};
void autonomous( long time,DFW & dfw);
void teleop( long time,DFW & dfw);
void robotShutdown(void);
#endif