Hi, I’ve been having some problems with my VEX Integrated Encoders.
The first encoder daisy-chained to the brain works (green light blinking), but all the subsequent ones don’t (solid red light). I had it display the ticks to the LCD, and the first encoder works.
I’ve tried:
Switching to a spare brain,
Switching out the first and second encoders,
Switching to older programs,
Switching the daisy chain order, and
Switching the wires connecting the encoders
Thanks!
It’s difficult to debug what seems to be a hardware issue for you as you have tried many different things already. Most of the time problems like this have simple solutions, often just a bad cable, try the following.
- Make sure all firmware is up to date, cortex should be on 4.25, re-download the RobotC firmware just to be safe, hopefully you are using RobotC version 4.55
- Make sure you have a fresh battery.
- Test two IMEs (plug in the first one and check it, then replace it with the second one and check that) using the same cable and verify each one gives a green led when you power up the cortex.
- Test the same two IMEs using a different cable, now you should have two good IMEs and two good cables. If you have found a bad IME or cable then replace it with a good one.
- Try both IMEs together, make sure the cables are plugged in all the way as they can be hard to push in sometimes, have a look at the IME connector before you do this and check there are no bent or broken pins. The second IME should flash its LED green twice in quick succession.
Try this simple program, look in the debugger windows, turn each motor by hand, are the IMEs counting?
#pragma config(I2C_Usage, I2C1, i2cSensors)
#pragma config(Sensor, I2C_1, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Sensor, I2C_2, , sensorQuadEncoderOnI2CPort, , AutoAssign )
#pragma config(Motor, port2, motorA, tmotorVex393_MC29, openLoop, encoderPort, I2C_1)
#pragma config(Motor, port3, motorB, tmotorVex393_MC29, openLoop, encoderPort, I2C_2)
//*!!Code automatically generated by 'ROBOTC' configuration wizard !!*//
int ime1;
int ime2 ;
task main()
{
while(1) {
ime1 = nMotorEncoder motorA ];
ime2 = nMotorEncoder motorB ];
wait1Msec(25);
}
}