Log in

View Full Version : Victors not working with other code?


TPNigl
17-02-2010, 12:37
Ok, so we've got a lot of stuff working. However, we also have a problem. We're using java, and we have the robot drive defined and working fine. However, when we try to introduce code that simply controls the victor to activate the motor, not only do they not work, but the robot drive no longer works. Here's our declaration:

m_robotDrive = new RobotDrive(1, 3, 2, 4);

vctrCtrWheelLift = new Victor (5);
vctrKickerMotorFront = new Victor (6);
vctrKickerMotorRear = new Victor (7);
vctrArmMotor1 = new Victor (8);
vctrArmMotor2 = new Victor (9);

And here is the code we're trying to get to work with the motors being solely by the victors:

if (jStickDriveLeft.getRawButton(1) && !prxCtrWheelUp.get())
vctrCtrWheelLift.set(1.0);
else
vctrCtrWheelLift.set(0.0);

if (!jStickDriveLeft.getRawButton(1) && !prxCtrWheelDown.get())
vctrCtrWheelLift.set(1.0);
else
vctrCtrWheelLift.set(0.0);

Any suggestions?

Alan Anderson
17-02-2010, 21:27
prxCtrWheelUp has no effect in this code fragment. Do you really want vctrCtrWheelLift to run full speed forward only when the left joystick trigger is pressed and prxCtrWheelDown is false, and to stop otherwise?

TPNigl
17-02-2010, 21:46
Yea, we do. But we got it to work and it's fine. Thanks anyway!