Пример #1
0
bool DRV_ADC_SamplesAvailable(void)
{
    /* Wait for DONE Flag */
    while (!PLIB_ADC_ConversionHasCompleted(DRV_ADC_ID_1));
	
    return true;
}
Пример #2
0
int readPotentiometer(void)
{
    PLIB_ADC_SamplingStart(ADC_ID_1);
    
    while (!PLIB_ADC_ConversionHasCompleted(ADC_ID_1));

    return PLIB_ADC_ResultGetByIndex(ADC_ID_1, 0);
}