-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDriveSubsystem.cpp
More file actions
40 lines (31 loc) · 971 Bytes
/
DriveSubsystem.cpp
File metadata and controls
40 lines (31 loc) · 971 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
36
37
38
39
#include "WPILib.h"
#include "Pneumatic.cpp"
#include "PinDefinitions.h"
/* This is a simple wrapper for RobotDrive.
* Includes TankDrive w/ Super Shifters
*/
//TODO: Possibly a Talon current check to prevent burnouts.
class DriveSubsystem : public RobotDrive {
Pneumatic SuperShifter; //Super Shifter Pneumatic
public:
DriveSubsystem ( ) :
RobotDrive (DRIVE_FRONTLEFT, DRIVE_REARLEFT, DRIVE_FRONTRIGHT, DRIVE_REARRIGHT),
SuperShifter (DRIVE_SUPERSHIFTSOLIN, DRIVE_SUPERSHIFTSOLOUT)
{ }
void TankDrive(Joystick &rightStick, Joystick &leftStick)
{
RobotDrive::TankDrive(leftStick, rightStick);
if (leftStick.GetRawButton(1) && SuperShifter.Get() == false)
{
SuperShifter.Set(true); //Push pistons out
}
else if (leftStick.GetRawButton(1) == false && SuperShifter.Get())
{
SuperShifter.Set(false); //Pull pistons in
}
}
void TankDrive(float leftValue, float rightValue)
{
RobotDrive::TankDrive(leftValue, rightValue);
}
};