View Single Post
  #14   Spotlight this post!  
Unread 25-08-2004, 14:50
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Potentiometer Question, we need help!

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]