|
Victors in reverse not responding.
Hi there!
I'm one of the programming mentors for Team 1796 and we're encountering a problem with our Victors not responding when trying to go in reverse; the Victors respond moving forward. I've included a scaled down base code that still won't work. I know there must be something simple I'm missing...what is it??? Thanks in advance, everyone!
Code:
package org.team1796;
import edu.wpi.first.wpilibj.Compressor;
import edu.wpi.first.wpilibj.Jaguar;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.SimpleRobot;
import edu.wpi.first.wpilibj.Solenoid;
import edu.wpi.first.wpilibj.Victor;
import edu.wpi.first.wpilibj.Timer;
import edu.wpi.first.wpilibj.camera.AxisCamera;
public class FRC2010Team1796 extends SimpleRobot {
private RobotDrive robotDrive = new RobotDrive(1,2);
private Joystick stickLeft = new Joystick(1);
private Joystick stickRight = new Joystick(2);
private AxisCamera cam;
private Victor claw1 = new Victor(3);
private Victor claw2 = new Victor(4);
private Victor arm1 = new Victor(5);
private Victor arm2 = new Victor(6);
private Compressor compressor = new Compressor(1,1);
private Solenoid armup = new Solenoid(7);
private Solenoid armdown = new Solenoid(8);
public FRC2010Team1796() {
getWatchdog().setExpiration(0.1);
compressor.start();
}
public void operatorControl() {
getWatchdog().setEnabled(false);
while (isEnabled() && isOperatorControl()) {
getWatchdog().feed();
if (stickRight.getRawButton(4)) {
claw1.set(-1.0);
claw2.set(-1.0);
} else {
claw1.set(0.0);
claw2.set(0.0);
}
if (stickRight.getTrigger()) {
claw1.set(1.0);
claw2.set(1.0);
} else {
claw1.set(0.0);
claw2.set(0.0);
}
if (stickRight.getRawButton(3)) {
claw1.set(-1.0);
claw2.set(1.0);
} else {
claw1.set(0.0);
claw2.set(0.0);
}
if (stickLeft.getRawButton(5)) {
arm1.set(1.0);
arm2.set(1.0);
} else {
arm1.set(0.0);
arm2.set(0.0);
}
if (stickLeft.getRawButton(4)) {
arm1.set(-1.0);
arm2.set(-1.0);
} else {
arm1.set(0.0);
arm2.set(0.0);
}
if (stickLeft.getTrigger()) {
armup.set(true);
} else {
armup.set(false);
}
if (stickLeft.getRawButton(3)) {
armdown.set(true);
} else {
armdown.set(false);
}
robotDrive.arcadeDrive(stickLeft);
}
//}
}
}
Thanks! We're really stuck here.
__________________
2014 Attended: NYC Regional, SBPLI Regional NYC Regional- Imagery Award in honor of Jack Kamen
2013 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- Gracious Professionalism Award sponsored by Johnson & Johnson,SBPLI Regional- #4 Alliance Captain & Regional Winner- With our impeccable alliance 358 and 3171
2012 Attended: NYC Regional, SBPLI Regional, FIRST Championships NYC Regional- #7 Ranked Seed & Semi-Finalists, SBPLI Regional- #3 Seed & Regional Winner- With our very awesome alliance 527 and 870, Industrial Design Award sponsored by General Motors
2011 Attended: NYC Regional, SBPLI Regional SPBLI Regional- Xerox Creativity Award and #5 Alliance Captain
2009 Attended: NYC Regional, FIRST Championships NYC Regional Winner- With our amazing alliance 1807 and 56
Last edited by RoboTigers1796 : 02-03-2011 at 19:08.
|