DeepSpace
2019
Piston.cpp
Go to the documentation of this file.
1
#include "
Subsystems/Piston.h
"
2
3
Piston::Piston
() : frc::Subsystem(
"Piston"
) {
4
this->
pSolenoid
=
new
frc::Solenoid(
PCM_CAN_ID
,
PISTON_ID
);
5
}
6
7
void
Piston::InitDefaultCommand
() {
8
SetDefaultCommand(
new
ControlSlider
());
9
}
10
11
void
Piston::Deploy
() {
12
this->
pSolenoid
->Set(
true
);
13
}
14
15
void
Piston::Retract
() {
16
this->
pSolenoid
->Set(
false
);
17
}
Piston::InitDefaultCommand
void InitDefaultCommand() override
Initalizes the default command for this subsystem (ControlPiston)
Definition:
Piston.cpp:7
PISTON_ID
#define PISTON_ID
Definition:
RobotMap.h:89
Piston::pSolenoid
frc::Solenoid * pSolenoid
Pointer to Solenoid.
Definition:
Piston.h:18
PCM_CAN_ID
#define PCM_CAN_ID
Definition:
RobotMap.h:87
Piston::Deploy
void Deploy()
Deploy the piston.
Definition:
Piston.cpp:11
Piston.h
Piston::Retract
void Retract()
Retract the piston.
Definition:
Piston.cpp:15
Piston::Piston
Piston()
Class constructor.
Definition:
Piston.cpp:3
ControlSlider
An interface command for driving the robot with an xbox controller.
Definition:
ControlSlider.h:12
src
main
cpp
Subsystems
Piston.cpp
Generated by
1.8.13