p2_x and p2_y are unsigned integers. When your subtract from them to end up with a negative value, the computer will start to have problems. Store them in signed integers before you try to subtract 122.
basically change this:
Code:
if(p2_x<122) //more than 5 below 127
{
deadx = ((p2_x - 122) * 127)/122 + 127;
}
to
Code:
if(p2_x<122) //more than 5 below 127
{
int drive_x=p2_x;
deadx = ((drive_x - 122) * 127)/122 + 127;
}
Also, my team has found that the outputs from the victors is way asymetrical, and that they have their own, fairly large dead zone that doesn't happen to be centered about 127.