How are the IME’s being attached between one another (meaning, are you chaining multiple cables together to reach the motors that are further away from the base of the robot/Cortex)? If so, there is a possibility that there is signal loss occurring due to the length of the cables.
Before we test that, though, please run the code below on the robot and turn the motors slightly by hand. You should see the values increase/decrease accordingly on the Debug Stream debugger window and in the Motors debugger window.
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, dgtl11, ClawSensor, sensorTouch)
#pragma config(Sensor, I2C_1, LeftTowerEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Sensor, I2C_2, RightTowerEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Sensor, I2C_3, LeftDriveEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Sensor, I2C_4, RightDriveEncoder, sensorQuadEncoderOnI2CPort, , AutoAssign)
#pragma config(Motor, port1, ClawMotor, tmotorVex393_HBridge, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port2, FrontRightDrive, tmotorVex393_MC29, openLoop, reversed, driveRight, encoderPort, I2C_2)
#pragma config(Motor, port3, BackLeftDrive, tmotorVex393_MC29, openLoop, driveRight, encoderPort, I2C_3)
#pragma config(Motor, port4, FrontLeftDrive, tmotorVex393_MC29, openLoop, driveLeft, encoderPort, I2C_4)
#pragma config(Motor, port5, BackRightDrive, tmotorVex393_MC29, openLoop, reversed, driveLeft)
#pragma config(Motor, port6, LeftArmTowerTop, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port7, RightArmTowerTop, tmotorVex393_MC29, openLoop, driveLeft)
#pragma config(Motor, port8, LeftArmTowerBottom, tmotorVex393_MC29, openLoop, driveRight)
#pragma config(Motor, port9, RightArmTowerBottom, tmotorVex393_MC29, openLoop)
#pragma config(Motor, port10, Gimbol, tmotorVex393_HBridge, openLoop, reversed, driveRight)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
#pragma DebuggerWindows("debugStream")
task main()
{
nMotorEncoder[ClawMotor] = 0;
nMotorEncoder[FrontLeftDrive] = 0;
nMotorEncoder[FrontRightDrive] = 0;
nMotorEncoder[BackLeftDrive] = 0;
nMotorEncoder[BackRightDrive] = 0;
while(true)
{
writeDebugStreamLine("Encoder1: %d", nMotorEncoder[ClawMotor]);
sleep(10);
writeDebugStreamLine("Encoder2: %d", nMotorEncoder[FrontRightDrive]);
sleep(10);
writeDebugStreamLine("Encoder3: %d", nMotorEncoder[BackLeftDrive]);
sleep(10);
writeDebugStreamLine("Encoder4: %d", nMotorEncoder[FrontLeftDrive]);
sleep(10);
writeDebugStreamLine("Encoder5: %d", nMotorEncoder[BackRightDrive]);
sleep(10);
}
}
Please let us know if this code works correctly with your current setup and we will be more than happy to assist you further.