Line 7: Line 7:
  
 
[[File:Pic16f877aADC01.PNG]]<br><br>
 
[[File:Pic16f877aADC01.PNG]]<br><br>
 +
 +
=Demo=
 +
[[File:Pic16f877a adc00.gif]]<br><br>

Revision as of 18:29, 28 April 2016


Code

#include "adc.h"
#include "uart.h"
int main()
{
int adcValue;
ADC_Init(); /* Initialize the ADC module */
UART_Init(9600); /* Initialize UART at 9600 baud rate */
while(1)
{
adcValue = ADC_GetAdcValue(0); // Read the ADC value of channel zero
UART_Printf("ADC0 Value:%4d \n\r",adcValue); // Send the value on UART
}
return (0);
}

Pic16f877aADC01.PNG

Demo

Pic16f877a adc00.gif