Skip to content

Instantly share code, notes, and snippets.

@SaheblalBagwan
Created August 20, 2016 10:55
#include "adc.h"
#include "uart.h"
void main(void)
{
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:%3d \n\r",adcValue); // Send the value on UART
}
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment