Other Parts Discussed in Thread: SYSCONFIG
HI
I have used an example (see below) and have a single ADC channel being sampled on DIO23 I would like to use my code and sample a second channel on DIO24 I don't think you can do these simultaneously and if not then I would like to sample immediately after the first sample can you please assist
/*
* ======== threadFxn0 ========
* Open an ADC instance and get a sampling result from a one-shot conversion.
*/
void *threadFxn0(void *arg0)
{
ADC_Handle adc;
ADC_Params params;
int_fast16_t res;
ADC_Params_init(¶ms);
adc = ADC_open(CONFIG_ADC_0, ¶ms);
if (adc == NULL) {
Display_printf(display, 0, 0, "Error initializing CONFIG_ADC_0\n");
while (1);
}
/* Blocking mode conversion */
res = ADC_convert(adc, &adcValue0);
if (res == ADC_STATUS_SUCCESS) {
adcValue0MicroVolt = ADC_convertRawToMicroVolts(adc, adcValue0);
Display_printf(display, 0, 0, "CONFIG_ADC_0 raw result: %d\n", adcValue0);
Display_printf(display, 0, 0, "CONFIG_ADC_0 convert result: %d uV\n",
adcValue0MicroVolt);
}
else {
Display_printf(display, 0, 0, "CONFIG_ADC_0 convert failed\n");
}
ADC_close(adc);
return (NULL);
}
Regards
David