2
0
mirror of https://github.com/team2059/Dent synced 2024-12-18 20:52:29 -05:00
dent/Subsystems/Pneumatics.cpp

32 lines
985 B
C++
Raw Normal View History

2015-02-20 15:54:41 -05:00
#include "Pneumatics.h"
2015-02-20 11:27:39 -05:00
#include "../RobotMap.h"
2015-07-31 12:52:15 -04:00
Pneumatics::Pneumatics(): Subsystem("Pneumatics") {
2015-09-18 11:39:18 -04:00
compressor = new Compressor(COMPRESSOR_PCM_CAN);
solenoid1 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_ONE);
solenoid2 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_TWO);
solenoid3 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_THREE);
solenoid4 = new Solenoid(COMPRESSOR_PCM_CAN, BINELEVATOR_SOLENOID_FOUR);
2015-09-18 11:39:18 -04:00
armState = false;
2015-02-20 11:27:39 -05:00
}
2015-09-19 17:57:42 -04:00
void Pneumatics::InitDefaultCommand() {}
2015-09-18 11:39:18 -04:00
void Pneumatics::SetArmsOpen(bool state) {
solenoid1->Set(state);
solenoid2->Set(!state);
armState=state;
}
2015-10-08 12:14:57 -04:00
void Pneumatics::SetElevatorArmOpen(bool state){
solenoid3->Set(state);
solenoid4->Set(!state);
2015-02-20 11:27:39 -05:00
}
2015-09-19 08:59:15 -04:00
void Pneumatics::SetCompressorEnabled(bool state) {
2015-09-18 11:39:18 -04:00
compressor->SetClosedLoopControl(state);
}
2015-09-19 08:59:15 -04:00
bool Pneumatics::GetArmsOpen() {
2015-09-18 11:39:18 -04:00
return armState;
}
2015-09-19 08:59:15 -04:00
bool Pneumatics::GetCompressorEnabled() {
2015-09-18 11:39:18 -04:00
return compressor->Enabled();
}
2015-02-20 11:27:39 -05:00
// vim: ts=2:sw=2:et