forked from iliterobotics/frc1885-2014
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bhs_Actuator.h
59 lines (49 loc) · 1.18 KB
/
bhs_Actuator.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
#ifndef BHS_ACTUATOR_H
#define BHS_ACTUATOR_H
#include <vector>
#include "WPILib/Talon.h"
#include "WPILib/Relay.h"
#include "WPILib/Solenoid.h"
#include "WPILib/DoubleSolenoid.h"
/**
Encapsulates all types of actuators:
- Variable speed motors (Talons)
- Constant speed motors (Relays)
- Pneumatics (Solenoids and DoubleSolenoids)
*/
class bhs_Actuator {
public:
/*
Identifies the type of the Actuator.
*/
static typedef enum {
k_talon = 0,
k_relay,
k_solenoid,
k_doubleSolenoid
} ActuatorType;
// Constructor for Talons and Soleniods
bhs_Actuator(ActuatorType, UINT32);
// Constructor for DoubleSolenoid
bhs_Actuator(ActuatorType, UINT32, UINT32);
// Constructor for Relays
bhs_Actuator(ActuatorType, UINT32, Relay::Direction);
~bhs_Actuator();
/*
Actuates Talons at specified speed
If Actuator is not a Talon, move forward if parameter is positive, backward if negative.
*/
void move(float);
void move(Relay::Value);
void move(bool);
void move(DoubleSolenoid::Value);
void moveTo(float);
void moveTo(int);
private:
ActuatorType m_type;
Talon m_talon;
Relay m_relay;
Solenoid m_solenoid;
DoubleSolenoid m_doubleSolenoid;
};
#endif // BHS_ACTUATOR_H