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!


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.

What do the LEDs on the Victors do when you command reverse?

the LED’s don’t change (remains orange).

If button 4 is pressed but not the trigger button, then claw 1 and 2 will be set to -1 and then immediately overwritten by 0 based on the trigger button if statement.

A nested if - else if - else structure is what you need.

of course! a million thank you’s!!!