Log in

View Full Version : Compressor not starting


VD3626
15-01-2015, 16:35
This is the code I have been using to try and get the compressor to run. The test motor is there just to tell me whether or not the compressor is getting the message to start or not. The motor runs no matter what I try to change which is strange because I am setting "SetClosedLoopControl" to true yet it does not seem to change to true.
void AutonomousCommand::Execute() {
compOneCompressorOne->SetClosedLoopControl(true);
if(compOneCompressorOne->GetClosedLoopControl() == false)
{
Robot::testMotor->Go();
}
}
Any help is appreciated.

MHSrobotics2853
15-01-2015, 22:59
You have to "Start" the Compressor class. It's a function of the class.

http://first.wpi.edu/FRC/roborio/development/docs/cpp/classCompressor.html

Ah, my bad, forgot it was enabled by default. See response below vvvv

Alan Anderson
15-01-2015, 23:00
I'm pretty sure the compressor isn't enabled until you have defined at least one pneumatic solenoid. And it's enabled by default; you don't have to explicitly turn on closed loop control. You only have to worry about it if you ever want to disable it.