Hey everyone! this is our first year using really any kind of pneumatics, our team has all of the hardware, (PCM, Compressor, DoubleSolenoids etc) what we would like is the basic understanding of the coding side of things, i understand that you need to write the PCM in CAN, im really unsure of what that entails. here is the code right now
/**
* This function is run when the robot is first started up and should be
* used for any initialization code.
*
*/ RobotDrive myDrive, frontCatcher, backCatcher, windowDrive;
Joystick moveStick;
Relay Relay1, Relay2;
//ADXRS450_Gyro scotbot;
//Solenoid S;
Compressor C;
DoubleSolenoid DS;
public void robotInit() {
Talon TalLF = new Talon(0);
Talon TalLR = new Talon(1);
Talon TalRF = new Talon(2);
Talon TalRR = new Talon(3);
Jaguar Window1 = new Jaguar(4);
Jaguar Window2 = new Jaguar(5);
//Talon TalCatcher = new Talon(4);
//Talon TalCatcher1 = new Talon(5);
//Talon TalCatcher2 = new Talon(6);
myDrive = new RobotDrive(TalLF,TalLR,TalRF,TalRR);
//frontCatcher = new RobotDrive(TalCatcher,TalCatcher1);
//backCatcher = new RobotDrive(TalCatcher1, TalCatcher2);
windowDrive = new RobotDrive(Window1, Window2);
moveStick = new Joystick(0);
//scotbot = new ADXRS450_Gyro();
DoubleSolenoid DS = new DoubleSolenoid(0, 1);
Compressor C = new Compressor(0);
Relay1 = new Relay(0);
Relay2 = new Relay(1);
}
/**
* This function is called periodically during autonomous
*/
public void autonomousPeriodic() {
myDrive.mecanumDrive_Cartesian(1, 1, 1, 0);
// catcherDrive.drive(1, 0);
}
/**
* This function is called periodically during operator control
*/
public void teleopPeriodic() {
C.setClosedLoopControl(false);
myDrive.mecanumDrive_Cartesian(moveStick.getRawAxis(0), moveStick.getRawAxis(1), -moveStick.getRawAxis(5), 0);
if(moveStick.getRawButton(3))
{
windowDrive.drive(1,1);
}
else
if (moveStick.getRawButton(2))
{
windowDrive.drive(-1,1);
}
}
but every time we enable the teleop it shorts out and exits very quickly.
Thanks