When I try to deploy my code, the robot crashes and it has the error message “Resource Already Allocated” appears. The error message implies that two Digital Inputs are being set to the same port, or something similar. The problem is, I’m not setting two Digital Inputs to the same port, I’m setting a Digital Input and a CAN Talon to the same port.
Are you setting a Digital Input and an encoder on the same port? Can we see your code?
The motor montroller and DIO should have different address spaces.
Is an encoder wired to the Talon? If so, are you creating an encoder object for it specifically? Instead, you should be getting the encoder as an object within the Talon.
Robot Map:
/// CAN Motors
public static int rightMotor = 1;
public static int leftMotor = 2;
public static int rightMotorSlave = 3;
public static int leftMotorSlave = 4;
/// Digital Inputs
public static int leftLineSensor = 1;
public static int middleLineSensor = 2;
public static int rightLineSensor = 3;
Chassis:
WPI_TalonSRX leftMotor = new WPI_TalonSRX(RobotMap.leftMotor);
WPI_TalonSRX rightMotor = new WPI_TalonSRX(RobotMap.rightMotor);
WPI_TalonSRX leftMotorSlave = new WPI_TalonSRX(RobotMap.leftMotorSlave);
WPI_TalonSRX rightMotorSlave = new WPI_TalonSRX(RobotMap.rightMotorSlave);
Digital Inputs:
public static DigitalInput leftSensor = new DigitalInput(RobotMap.leftLineSensor);
public static DigitalInput rightSensor = new DigitalInput(RobotMap.middleLineSensor);
public static DigitalInput middleSensor = new DigitalInput(RobotMap.rightLineSensor);
We don’t have any encoders
Never-mind, it magically started working again. : )