-
Notifications
You must be signed in to change notification settings - Fork 2
/
Collector.h
71 lines (52 loc) · 1.86 KB
/
Collector.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
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
#ifndef COLLECTOR_H
#define COLLECTOR_H
#include <WPILib.h>
#include "Swag.h"
class Collector {
public:
// These methods are visable (callable) to anyone using this class
// If you wish to add or remove any public methods, talk to Nick Papadakis
// Constructor
Collector(Swag* theSwagIn, UINT32 BotFloorOpenSwitch, UINT32 BotFloorCloseSwitch, UINT32 bucketThingy);
//Initializes
void Init();
//Checks to see if we're done dropping a disc
bool doneDropping();
//Drops a disc
void dropDisc();
//Changes the floor control to manual mode
void manualMode(bool mode);
//Manual control of the collector
void manualFloorControl(int direction);
//Various test functions for debugging
string getState();
bool isFloorOpen() { return BottomFloorOpenSwitch->Get(); }
bool isFloorClosed() { return BottomFloorCloseSwitch->Get(); }
bool isFrisbeeReady() { return bucketStatusSwitch->Get(); }
void lockServos() { lockingServos = true; }
void unlockServos() { lockingServos = false;}
void closeFloor() { closingFloor = true; openingFloor = false; }
void openFloor() { openingFloor = true; closingFloor = false; }
void stopFloor() { closingFloor = false; openingFloor = false; }
//General processing
void Idle();
//Shuts off motors, empties Queue
void Disable();
private:
struct ST {
enum CollectorState { READY, SERVOS_LOCK, FLOOR_OPEN, FLOOR_WAIT, FLOOR_CLOSE, SERVOS_UNLOCK, };
};
ST::CollectorState CS;
bool Initialized;
bool manual;
DigitalInput *bucketStatusSwitch;
DigitalInput *BottomFloorOpenSwitch;
DigitalInput *BottomFloorCloseSwitch;
Relay *FloorDrive;
Servo *ServoLockRight;
Servo *ServoLockLeft;
Timer *AllPurposeTimer;
bool lockingServos, closingFloor, openingFloor;
Swag* theSwag;
};
#endif