We are trying to run our NEO Vortex’s with the Spark Flex motor controller with code, but are unable too. Running them in the REV Hardware client works, but we are unable to run them any other way.
package frc.robot.subsystems;
import edu.wpi.first.wpilibj2.command.SubsystemBase;
import com.revrobotics.CANSparkFlex;
import com.revrobotics.CANSparkLowLevel.MotorType;
public class testNeoMotor extends SubsystemBase {
private static testNeoMotor instance;
public static testNeoMotor getInstance() {
if (instance == null) instance = new testNeoMotor();
return instance;
}
private CANSparkFlex testMotor;
public testNeoMotor() {
testMotor = new CANSparkFlex(23, MotorType.kBrushless);
}
public void spinMotor(double voltage) {
testMotor.setVoltage(voltage);
}
@Override
public void periodic() {
}
}
^^^ This is our subsystem code for the motor (we do have code in the robot container file to spin the motor at 6 volts when a button on the controller is pressed)
We are running the newest version of WPILib with the latest REVLib and newest firmware for the motor controller. We have tried all of the troubleshooting steps and are still unsure of the problem
Any help would be appreciated!