Our code that gets axis informations from Xbox controller and sets motor speed based on that infos are not working, here is the code:
package frc.robot;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.motorcontrol.PWMTalonSRX;
import edu.wpi.first.wpilibj.motorcontrol.PWMVictorSPX;
import edu.wpi.first.wpilibj.XboxController;
/**
* The VM is configured to automatically run this class, and to call the functions corresponding to
* each mode, as described in the TimedRobot documentation. If you change the name of this class or
* the package after creating this project, you must also update the build.gradle file in the
* project.
*/
public class Robot extends TimedRobot{
PWMTalonSRX talon = new PWMTalonSRX(0);
PWMVictorSPX victor = new PWMVictorSPX(1);
XboxController controller = new XboxController(0);
double leftAxis = controller.getLeftX();
double rightAxis = controller.getLeftY();
double motorPower = leftAxis+(rightAxis*-1);
@Override
public void teleopPeriodic() {
talon.set(motorPower);
victor.set(motorPower);
System.out.println(motorPower);
}