This simple application reads ADSmartIO channels PA0 - PA7. It illustrates how to dynamically link to the ADSmartIO library and read A/D channels. All output is to the debug port.
To convert the A/D readings to a voltage, use the following equation:
Vin = counts / 1023 * Vref
where counts is the reading from the A/D Vref is the reference voltage of the A/D converter (e.g. 2.5V for ADSmartIO) and Vin is the analog input voltage
Note that there may be additional conversion factors needed. For example, the PA7 input on the BitsyX is connected to the power input through a voltage divider, and must be multiplied by 7.2 to yield the input voltage.