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

Problemos LCD

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



Joined: 07 Jan 2004
Posts: 22
Location: Frankfurt, Germany

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

Problemos LCD
PostPosted: Mon Dec 05, 2005 10:18 am     Reply with quote

Hi folks,

could anybody give me a solution for this problem:
Writing to a LCD like printf(lcd_putc,"\f Power=%4.0f dBm",floatvalue) will change the position with the size of the variable. This leads to the unwanted situation that the number is jumping around depending on the number of characters from one to four. I don't like to use leading zeros (%04.0f), because this is not comfortable to read.

Thanks in advance
Saludos
Jorge
Georg Prinz



Joined: 07 Jan 2004
Posts: 22
Location: Frankfurt, Germany

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

problemos lcd
PostPosted: Mon Dec 05, 2005 2:34 pm     Reply with quote

to complete my question: I'am using PCWH, Rev. 3.212
Saludos
Jorge
_________________
dl 2 kp
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 05, 2005 3:33 pm     Reply with quote

Here is one suggested method:
http://www.ccsinfo.com/forum/viewtopic.php?t=15173&highlight=lcd+spaces
Ttelmah
Guest







PostPosted: Mon Dec 05, 2005 3:45 pm     Reply with quote

It ought to work on the currentish versions (3.236). There were problems with the float number justification, till a few versions ago, and 3.212, has these, requiring you to use a 'bodge around' as outlined...
On 3.236, the number correctly justifies with the leading spaces.
It might be worth checking if the integer output has the same problem. Given you are not using anything after the DP, if you used:

printf(lcd_putc,"\f Power=%4Ld dBm",(int16)floatvalue)

It is just possible it might wk.

Best Wishes
Georg Prinz



Joined: 07 Jan 2004
Posts: 22
Location: Frankfurt, Germany

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

PostPosted: Tue Dec 06, 2005 5:16 am     Reply with quote

Thank you both javascript:emoticon('Very Happy')! It`s working now, even with characters after the decimal point, multiplying by hundred and converting it to integer. Well, I'am not happy with loosing lot of cycles, but it helps.

Saludos

Jorge
_________________
dl 2 kp
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