View Single Post
  #6   Spotlight this post!  
Unread 29-03-2004, 11:14
TomJoseph TomJoseph is offline
The Pirate
#0247 ('Da Bears)
Team Role: Mentor
 
Join Date: Mar 2004
Location: Michigan
Posts: 3
TomJoseph is an unknown quantity at this point
Send a message via ICQ to TomJoseph Send a message via AIM to TomJoseph
Re: Potentiometer Question, we need help!

Quote:
Originally Posted by KenWittlief
I think your 'shift' is the wrong way - that is a shift left, which will push the 10 bit ADC input up to a 12 bit number;

usually you want to knock the Analog inputs down to 8 bits from 10, a shift right (arrows to the right) >>2;

:^);
You'll also want to typecast it into an unsigned char, just for safe keeping:
Code:
unsigned char pot1;
pot1 = (unsigned char) (Get_Analog_Value(rc_ana_01) >> 2);