User Manual
ADC-20/ADC-24 User's Guide 22
Copyright © 2005-2010 Pico Technology Ltd. All rights reserved. adc20.en
// this would be HRDL_ANALOG_IN_CHANNEL_8 for the ADC-20
if(channelNo > HRDL_ANALOG_IN_CHANNEL_16)
{
channelNo = HRDL_ANALOG_IN_CHANNEL_1;
}
}
else
{
// do something else while waiting for the reading from the
// unit
}
}
}
void PollSingleValue(short handle,
BOOL *bConversionFinished,
long *lValue,
short channel,
short range,
short singleEnded)
{
static BOOL bStartConversion = FALSE;
short overflow;
// test to see if the conversion has finished
if(bStartedConversion)
{
if(HRDLReady(handle))
{
HRDLGetSingleValueAsync(handle, lValue, &overflow);
bConversionFinished = TRUE;
bConversionStarted = FALSE;
}
}
// test to see if no conversion is in progress
if(!bStartedConversion)
{
//start the conversion going
bStartedConversion = HRDLCollectSingleValueAsync(handle,
channel,
range,
conversionTime,
singleEnded);
bConversionFinished = TRUE;
}
}