I need some help.
When I deploy the code, I keep getting a error:
`Unhandled exception: java.lang.IllegalStateException: A CANSparkMax instance has already been created with this device ID: 9
Error at com.revrobotics.CANSparkMaxLowLevel.<init>(CANSparkMaxLowLevel.java:137): Unhandled exception: java.lang.IllegalStateException: A CANSparkMax instance has already been created with this device ID: 9
at com.revrobotics.CANSparkMaxLowLevel.<init>(CANSparkMaxLowLevel.java:137)
The robot program quit unexpectedly. This is usually due to a code error.
The above stacktrace can help determine where the error occurred.
See https://wpilib.org/stacktrace for more information.
from: edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:358)
at com.revrobotics.CANSparkMax.<init>(CANSparkMax.java:191)
The startCompetition() method (or methods called by it) should have handled the exception above.
at frc.robot.subsystems.Arm.<init>(Arm.java:42)
at frc.robot.Robot.robotInit(Robot.java:33)
at edu.wpi.first.wpilibj.TimedRobot.startCompetition(TimedRobot.java:106)
at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:343)
at edu.wpi.first.wpilibj.RobotBase.startRobot(RobotBase.java:436)
at frc.robot.Main.main(Main.java:23)
Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:358): The robot program quit unexpectedly. This is usually due to a code error.
The above stacktrace can help determine where the error occurred.
See https://wpilib.org/stacktrace for more information.
Error at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:365): The startCompetition() method (or methods called by it) should have handled the exception above.
[phoenix-diagnostics] Server shutdown cleanly. (dur:0)
[phoenix] Library shutdown cleanly`
I’m confused because I only initialize one motor with this CAN ID in my code, and I checked my code and I made sure I only initialized one motor. I tried changing the motor ID to a different number but it still gave me the same error for some reason.