float anaInVolts(unsigned int channel, unsigned int gaincode);
Reads the state of a
PARAMETERS
channel is the channel number (0 to 7) corresponding to LN0_IN to LN7_IN
Channel Code |
| Voltage Range† | |
Input Lines* | (V) | ||
| |||
0 | +AIN0 | ||
|
|
| |
1 | +AIN1 | ||
|
|
| |
2 | +AIN2 | ||
|
|
| |
3 | +AIN3 | ||
|
|
| |
4 | +AIN4 | ||
|
|
| |
5 | +AIN5 | ||
|
|
| |
6 | +AIN6 | ||
|
|
| |
7 | +AIN7 |
* Negative input is ground.
† Applies to Prototyping Board.
‡ Used for thermistor in sample program.
gaincode is the gain code of 0 to 7.
Gain Code | Multiplier | Voltage Range* | |
(V) | |||
|
| ||
0 | ×1 | ||
|
|
| |
1 | ×2 | ||
|
|
| |
2 | ×4 | ||
|
|
| |
3 | ×5 | ||
|
|
| |
4 | ×8 | ||
|
|
| |
5 | ×10 | ||
|
|
| |
6 | ×16 | ||
|
|
| |
7 | ×20 | ||
|
|
|
* Applies to RCM3400 Prototyping Board.
RETURN VALUE
A voltage value corresponding to the voltage on the analog input channel. ADOVERFLOW (defined macro =
ADTIMEOUT (defined macro =
SEE ALSO
anaInCalib, anaIn, anaInmAmps, brdInit
54 | RabbitCore RCM4000 |