![Rabbit Coyote BL2500 User Manual Download Page 57](http://html1.mh-extra.com/html/rabbit/coyote-bl2500/coyote-bl2500_user-manual_3119445057.webp)
User’s Manual
51
Reads the voltage of a single-ended analog input channel using D/A channel DA0 for comparison to find
a match to the input voltage on channel AD0. This is done using a 10-step successive-approximation
binary search, which nominally takes 86 ms.
Call
pwmOutConfig()
and
pwm_init()
before using this function. An exception error will occur if
these functions were not been called previously.
NOTE:
DA0 should not be used when AD0 is in use.
PARAMETER
channel
is 0 for channel AD0
RETURN VALUE
A voltage value between 0 and 3.1 V for the analog input channel.
ADOVERFLOW
is returned (defined macro = -4096) on overflow or if the return value is out of range.
SEE ALSO
anaIn, pwmOutConfig, pwm_init
Calibrates the response of the A/D converter channel as a linear function using the two conversion points
provided. Values are calculated and placed into global table
_adcCalibS
for analog inputs to be stored
later into simulated EEPROM using the function
anaInEEWr()
.
Each channel will have a linear constant and a voltage offset.
PARAMETERS
channel
is 0 for channel AD0
value1
is the first A/D converter value (0–1023), usually a value of 310 that corresponds to 1.0 V
volts1
is the voltage corresponding to the first A/D converter value (0–3.3 V)
value2
is the second A/D converter value (0–1023), usually a value of 930 that corresponds to 3.0 V
volts2
is the voltage corresponding to the second A/D converter value (0–3.3 V)
RETURN VALUE
0 if successful
-1 if not able to make calibration constants
SEE ALSO
anaIn, anaInEERd, anaInEEWr
float anaInVolts(unsigned int channel);
int anaInCalib(int channel, int value1,
float volts1,int value2, float volts2);
Summary of Contents for Coyote BL2500
Page 1: ...Coyote BL2500 C Programmable Single Board Computer with Ethernet User s Manual 019 0120_M...
Page 6: ...Coyote BL2500...
Page 90: ...84 Coyote BL2500...
Page 104: ...98 Coyote BL2500...
Page 106: ......