/* The co-routine that reads the ADC and sends messages for display on the bottom row of the LCD.  */
static void prvADCCoRoutine(xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex)
/* The co-routine that reads the ADC and sends messages for display on the bottom row of the LCD.  */
static void prvADCCoRoutine(xCoRoutineHandle xHandle, unsigned portBASE_TYPE uxIndex)
{
static unsigned long ulADCValue;
static char cMessageBuffer[ mainMAX_ADC_STRING_LEN ];
static char *pcMessage;
static xLCDMessage xMessageToSend;
	crSTART( xHandle );
	for( ;; )
	{
		ADCProcessorTrigger( ADC_BASE, 0 );		crDELAY( xHandle, mainADC_DELAY );
		ADCSequenceDataGet( ADC_BASE, 0, &ulADCValue );		sprintf( cMessageBuffer, "ADC = %d   ", ulADCValue );
		pcMessage = cMessageBuffer;
		xMessageToSend.ppcMessageToDisplay = ( char** ) &pcMessage;
		xMessageToSend.xRow = mainBOTTOM_ROW;
		if( !xQueueSend( xLCDQueue, ( void * ) &xMessageToSend, 0 ) )
		{
			uxErrorStatus = pdFAIL;
		}	}
	crEND();
}