View previous topic :: View next topic |
Author |
Message |
nina
Joined: 20 Apr 2007 Posts: 111
|
pot and lcd |
Posted: Wed Jun 20, 2007 10:30 am |
|
|
hi,
this code write in my lcd in all lines and I want that be displayed in just the first line.
What can I do to correct this problem?
void main(void)
{
float pot;
lcd_init();
setup_port_a(ALL_ANALOG);
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
do{
set_adc_channel(0);
pot=read_adc();
printf(lcd_putc,"%f",pot);
delay_us(10);
}while(true);
}
thanks
nina |
|
|
inservi
Joined: 13 May 2007 Posts: 128
|
|
Posted: Wed Jun 20, 2007 10:54 am |
|
|
Hello,
You can call lcd_gotoxy( x, y) before printf.
as: Code: | lcd_gotoxy( 1, 1);
printf(lcd_putc,"%3.2f",pot);
|
Best regards,
dro. _________________ in médio virtus |
|
|
nina
Joined: 20 Apr 2007 Posts: 111
|
pot and lcd |
Posted: Wed Jun 20, 2007 11:28 am |
|
|
thanks inservi
I did what you told me but when I simulate over proteus i have the error
LOG THREAD DID NOT TERMINATE.
and if I change the potentiometer value...show me on lcd the same number
thanks
nina |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
nina
Joined: 20 Apr 2007 Posts: 111
|
sorry |
Posted: Thu Jun 21, 2007 4:51 am |
|
|
sorry PCM Programmer and thanks to correct me
Hug
Nina |
|
|
|