Thread: Analogs.....
View Single Post
  #4   Spotlight this post!  
Unread 17-01-2006, 22:33
Mike's Avatar
Mike Mike is offline
has common ground with Matt Krass
AKA: Mike Sorrenti
FRC #0237 (Sie-H2O-Bots (See-Hoe-Bots) [T.R.I.B.E.])
Team Role: Programmer
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Watertown, CT
Posts: 1,003
Mike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond reputeMike has a reputation beyond repute
Re: Analogs.....

Seems like your answer has been given, but I have a tad more things to add.

As many have said, an analog input is a range of values. If you have a 10 bit ADC (Analog to Digital Converter) it will be a 10 bit number (0 to 1023), 8 bit ADC is 0 to 254, etc. Our controller has a 10 bit ADC.

Analog devices work by taking a voltage in, applying resistance to it depending on a mechanical device and then outputting the modified voltage. That modified voltage is connected to the input pin of an ADC. The ADC is also connected to what is called a reference voltage. This reference voltage is what the inputted voltage will be compared to. It's kinda hard to explain, examples show it better:

Reference voltage: 5v
Input voltage: 5v
ADC: 10 bit
Output given: 1023

Reference voltage: 5v
Input voltage: 5v
ADC: 8 bit
Output given: 254

Reference voltage: 5v
Input voltage: 0v
ADC: 10 bit
Output given: 0

Reference voltage: 5v
Input voltage: 2.5v
ADC: 10 bit
Output given: 511Thanks Joe =)

So what it comes down to is: (InputVoltage / RefVoltage) * ADCsize

Hope I helped,
Mike
__________________
http://www.mikesorrenti.com/

Last edited by Mike : 18-01-2006 at 12:44.