#include   <stdio.h>		/********************************/
#include   "A826.h"             /*                              */
				/* for A826PGL			*/
unsigned int   Buffer[2000];	/*				*/
				/********************************/
main(void)
{
int  Ch,G,i,j;
float  volt,temp,v0,v1,v2,v3,v4,v5,v6,v7;
int PollData;
float rate=10.0/32768.0,val;

A826_Initialize(0,0x220,-1,-1);

for (;;)
{
Ch=0; G=0;				  /* Channel_0, Gain=1, Bipolar */
A826_AD_SetChGainMode(Ch,G,POLLING_MODE); /* Polling */
A826_Delay(23*2);			  /* GAIN setting time=23 us */
PollData=A826_AD_PollingVar();
volt=PollData*rate;
v0=volt;

Ch=1; G=1;				  /* Channel_1, Gain=2,  Bipolar*/
A826_AD_SetChGainMode(Ch,G,POLLING_MODE); /* Polling */
A826_Delay(23*2);			  /* GAIN setting time=23 us */
PollData=A826_AD_PollingVar();
volt=PollData*rate;
v1=volt/2.0;

Ch=2; G=2;				   /* Channel_2,Gain=4,  Bipolar*/
A826_AD_SetChGainMode(Ch,G,POLLING_MODE);  /* Polling */
A826_Delay(25*2);			   /* GAIN setting time=25  us */
PollData=A826_AD_PollingVar();
volt=PollData*rate;
v2=volt/4.0;

Ch=3; G=3;				   /* Channel_3,Gain=8, Bipolar*/
A826_AD_SetChGainMode(Ch,G,POLLING_MODE);  /* Polling */
A826_Delay(28*2);			   /* GAIN setting time=28   us */
PollData=A826_AD_PollingVar();
volt=PollData*rate;
v3=volt/8.0;
try:
printf("\nA826PGL:[0]=%7.5fV,[1]=%7.5fV,[2]=%7.5fV,[3]=%7.5f",v0,v1,v2,v3);
if (kbhit()!=0) {getch(); return;}
}
}
