The OI pots are only 8 bits; chars. The Analog inputs are 10 bits. so you do this:
Code:
unsigned char JoyPot;
unsigned int BotPot;
unsigned char BotPot2; //For comparison with the joystick
JoyPot = p3_y;
BotPot = Get_Analog_Value(rc_ana_in01);
BotPot2 = (unsigned char)(BotPot >> 2);
BotPot2 is now 8 bits; it can be used to compare with JoyPot.
By the sound of it, they're using signed long, which is 2-4 times larger than necessary (not to mention signing, which is a little weird).
[And I agree that this thread is a little misplaced]