I tried the following code:
Code: Select all
program ADC_on_LEDs
dim adc_rd as word
main:
UART1_Init(9600) '9600 baud UART speed
while TRUE ' endless loop
adc_rd = ADC_Read(2) ' get ADC value from 2nd channel
delay_ms(500) 'delay to make really sure AD conversion is finished
UART1_Write(adc_rd) 'output value to terminal
wend
end.
MCu and clock speed have been correctly assigned.
Any ideas?