Newer
Older
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
#ifndef BENNE_H
#define BENNE_H
class MicroSwitch;
class Benne
{
/**
* The ID of the AX12 used to drive the belts
*/
static const int SERVO_ID = 0; // To update
static const int FORWARD_SPEED = 1023;
static const int BACKWARD_SPEED = 2046;
public:
struct Status
{
enum Enum
{
UNKNOWN,
OPEN,
CLOSED,
OPENING,
CLOSING
};
};
static Benne* getInstance();
~Benne();
void update();
void setBenneEmpty();
void setBenneFull();
bool getIsBenneEmpty() const;
bool getIsBenneFull() const;
void empty();
void open();
void stop();
bool isFrontSwitchActive() const;
bool isBackSwitchActive() const;
Benne::Status::Enum getStatus() const;
private:
Benne();
void setStatus(Status::Enum status);
bool isBenneEmpty;
Status::Enum m_status;
MicroSwitch* m_backSwitch;
MicroSwitch* m_frontSwitch;
};
#endif // BENNE_H