2
0
mirror of https://github.com/team2059/Dent synced 2024-12-28 21:02:30 -05:00
dent/Subsystems/Pneumatics.cpp

39 lines
1.1 KiB
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-07-31 12:52:15 -04:00
void Pneumatics::InitDefaultCommand() {
2015-02-20 11:27:39 -05:00
}
2015-09-18 11:39:18 -04:00
void Pneumatics::SetArmsOpen(bool state) {
2015-07-31 12:52:15 -04:00
if(state) {
2015-02-20 11:27:39 -05:00
solenoid1->Set(true);
solenoid2->Set(false);
solenoid3->Set(true);
solenoid4->Set(false);
2015-09-18 11:39:18 -04:00
armState = true;
2015-07-31 12:52:15 -04:00
} else {
2015-02-20 11:27:39 -05:00
solenoid1->Set(false);
solenoid2->Set(true);
solenoid3->Set(false);
solenoid4->Set(true);
2015-09-18 11:39:18 -04:00
armState = false;
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