User`s manual

92 www.rabbit.com Applications Programming
flexAnaIn
int flexAnaIn( Flex_IOPin *pin );
DESCRIPTION
Reads the state of the external analog channel. Note that this is a raw value that has not been con-
verted to a voltage. The raw values are useful for calibration.
Also note that the value retrieved here is not read when requested; rather, the latest value that has
been calculated by the analog input interrupt service request is returned. The update rate is 2.5 ms
times the number of analog input channels.
This function is non-reentrant.
PARAMETER
pin Pointer to the information structure for the selected pin.
RETURN VALUE
0: a value corresponding to the voltage on the analog input channel (0–4095)
-1: overflow or out of range
-2: error (not an analog input?)
SEE ALSO
flexAnaInVolts, flexAnaInmAmps, flexAnaInCalib