chuka_709
Joined: 01 Sep 2010 Posts: 1 Location: Mongolia
|
18f452 ADC to serial |
Posted: Wed Sep 01, 2010 7:01 pm |
|
|
I want adc data send to SERIAL.
I read adc potentiometer. Potentiometr data not 0-255.
Potentiometer data is 0-255, 0-255, 0-255 and 0-255 4 times /0-255/
I think one time 0-255.
Code: |
#include <18F452.h>
#device adc=8
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
setup_adc_ports(RA0_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
set_adc_channel(0);
while(1)
{
putc(read_adc());
} |
_________________ It's my life... |
|