Thread: Analog Inputs
View Single Post
  #3   Spotlight this post!  
Unread 13-03-2006, 12:42
eugenebrooks eugenebrooks is offline
Team Role: Engineer
AKA: Dr. Brooks
no team (WRRF)
 
Join Date: Jan 2004
Rookie Year: 2001
Location: Livermore, CA
Posts: 601
eugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond reputeeugenebrooks has a reputation beyond repute
Re: Analog Inputs

Quote:
Originally Posted by bush
If we had an analog input device hooked up to Analog Input Port 1, what would the value rc_ana_in01 represent? Is it the voltage? Or possibly (Voltage * 1024 / 5)?
rc_ana_in01 is a constant that you pass to GetAnalogValue in order
to read the corresponding analog input.

For example:
int analogvaluefrominput01;
analogvaluefrominput01 = GetAnalogValue(rc_ana_in01);

The resulting value stored in the int variable has the range 0 to 1023
0 corresponds to roughly zero volts, and 1023 corresponds to roughly
5 volts. Your equation reflects that.

Edit: The analog inputs on the RC look at voltage. When a POT is
hooked up to one these inputs it is wired as a voltage divider for a
5 volt supply. The analog inputs on the OI have a different range,
0 to 255(254), and are set up to jump to 127 in the event that 0 volts is
applied (or the circuit opens), for safety reasons.

Eugene

Last edited by eugenebrooks : 13-03-2006 at 12:46.