The way our tank drive was made, one tranny was mounted so that 254 would drive forward, and one mounted so that 254 would drive backwards. To deal with this, I added the following bit of code to my Drive() function.
Code:
if(intSpeed > 127)
{
RIGHT_MOTORS = 127 - (intSpeed - 127);
}
else
{
RIGHT_MOTORS = 127 + (127 - intSpeed);
}
The problem with this though, is that forwards speed is always higher than backwards speed. To solve this, I took the backwards RPM and divided it by the forwards RPM. Then, on the side that was forwards, I had the following code
Code:
if(intSpeed > 127)
{
LEFT_MOTORS = intSpeed * .952;
}
else
{
LEFT_MOTORS = intSpeed * (1 / .952);
}
After Battlecry, the driver told me that it was still veering to the right. Could the maximum RPM's have changed? How do you guys get around backwards tranny's?