hi my team and i are new to frc we have done ftc and fll before and we cant fix our code we have some variables not used because we always make our variables first and when ever i put motor type this happens kBrushless cannot be resolved or is not a field and we our programming our can bus for it to our motor controllers are victorspx and talonsrx
here is our code since new accounts cant upload files
package frc.robot;
import edu.wpi.first.wpilibj.Joystick;
import edu.wpi.first.wpilibj.SpeedControllerGroup;
import edu.wpi.first.wpilibj.Talon;
import edu.wpi.first.wpilibj.TimedRobot;
import edu.wpi.first.wpilibj.VictorSP;
import edu.wpi.first.wpilibj.drive.RobotDriveBase.MotorType;
import edu.wpi.first.wpilibj.drive.DifferentialDrive;
import frc.robot.VictorSPX;
import frc.robot.CANTalon;
/**
-
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 {
private static final int leftdeviceid = 2;
private static final int rightdeviceid = 3;
private VictorSPX m_leftmotor;
private VictorSPX m_rightmotor;
// right motors
private final VictorSP rightmotor1 = new VictorSP(9);
private final VictorSP rightmotor2 = new VictorSP(1);
private final VictorSP leftmotor1 = new VictorSP(0);
private final VictorSP leftmotor2 = new VictorSP(2);
// shoot
private final Talon intakeleft = new Talon(3);
private final VictorSP intakeright = new VictorSP(2);
// intake
//speed controllers for movement
private final SpeedControllerGroup rightspeedGroup = new SpeedControllerGroup(rightmotor1, rightmotor2);
private final SpeedControllerGroup leftspeedGroup = new SpeedControllerGroup(leftmotor1, leftmotor2);
// the drivetrain
DifferentialDrive drivetrain = new DifferentialDrive(rightspeedGroup, leftspeedGroup);
//controlls
Joystick stick = new Joystick(0);
public void robotInit() {
m_rightmotor = new VictorSPX(rightdeviceid, MotorType.kBrushless);
m_leftmotor = new VictorSPX(rightdeviceid, MotorType.kBrushless);
}
public void robotPeriodic() {}
public void autonomousInit() {}
public void autonomousPeriodic() {}
public void teleopInit() {}
public void teleopPeriodic() {
drivetrain.arcadeDrive(stick.getY(), stick.getZ());
//shoot controlls
if(stick.getRawButton(1)){
intakeleft.set(1);
intakeright.set(1);
}else{
intakeleft.stopMotor();
intakeright.stopMotor();
}
}
public void disabledInit() {}
public void disabledPeriodic() {}
public void testInit() {}
public void testPeriodic() {}
}