blueroomelectronics
Well-Known Member
**broken link removed**
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
volatile unsigned int ADC_VALUE;
/* Selecting ADC channel */
ADCON0 = (ADC_Channel << 3) + 1; /* Enable ADC, Fosc/2 */
ADIE = 0; /* Masking the interrupt */
ADIF = 0; /* Resetting the ADC interupt bit */
ADRESL = 0; /* Resetting the ADRES value register */
ADRESH = 0;
ADGO = 1; /* Staring the ADC process */
while(!ADIF) continue; /* Wait for conversion complete */
ADC_VALUE = ADRESL; /* Getting MSB of CCP1 */
ADC_VALUE += (ADRESH << 8); /* Getting LSB of CCP1 */
return (ADC_VALUE); /* Return the value of the ADC process */
}
void main()