/*

This program demonstrates how to read the analog input channels. It
scans the channels in an infinite loop. Note that this program uses
_eioBrdAI, not eioBrdAI (the underscore). _eioBrdAI ONLY returns the
raw number returned by the ADC chip. _eioBrdAI is faster than
eioBrdAI, and it is suitable for applications in which the raw value
is used.

*/

#use eziopk25.lib

main() {
	auto int i;

	eioBrdInit(0);							//	initialize the board
	while (1) {								//	do this endlessly
		for (i = 0; i < 4; ++i) {		//	for each analog input
			printf("AIN%02d reads %04x\n",i,_eioBrdAI(i));
				//	print the reading
			hitwd();							//	hit the watchdog
		}
	}
}