Been having this issue I don’t know how to fix it any help would be nice
Heres another CD Thread on the same issue I believe.
But to summarize, you are defining and initializing your spark max objects in your constructor, you should be defining them outside of the constructor, because otherwise they will be inaccessible outside that function. So that would look something like this
private final CANSparkMax frontLeftMotor;
private final CANSparkMax rearRightMotor;
public CANDrivetrain() {
frontLeftMotor = new CANSparkMax(0, MotorType.kBrushless);
rearRightMotor = new CANSparkMax(1, MotorType.kBrushless);
}
1 Like
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.