CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

pot and lcd

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

pot and lcd
PostPosted: Wed Jun 20, 2007 10:30 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 20, 2007 10:54 am     Reply with quote

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

View user's profile Send private message Send e-mail

pot and lcd
PostPosted: Wed Jun 20, 2007 11:28 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Jun 20, 2007 2:46 pm     Reply with quote

Proteus VSM support forum:
http://support.labcenter.co.uk/forum/viewforum.php?f=9
nina



Joined: 20 Apr 2007
Posts: 111

View user's profile Send private message Send e-mail

sorry
PostPosted: Thu Jun 21, 2007 4:51 am     Reply with quote

sorry PCM Programmer and thanks to correct me

Hug

Nina
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group