/* Initiates an A/D conversion and reads the sample when done.  */
static uint16_t getAdcSample(void)
/* Initiates an A/D conversion and reads the sample when done.  */
static uint16_t getAdcSample(void)
{
   ADC_Start( ADC0, adcStartSingle );
   while( !( ADC_IntGet( ADC0 ) & ADC_IF_SINGLE ) )
      ;
   return ADC_DataSingleGet( ADC0 );
}