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

How to assign 6 digits values in PIC18LF14K50 ?

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



Joined: 09 Oct 2009
Posts: 3

View user's profile Send private message

How to assign 6 digits values in PIC18LF14K50 ?
PostPosted: Tue Oct 20, 2009 9:17 am     Reply with quote

I need to calculate input with such form +/- XX.XXX that is 6 consider integers and a decimal point is fixed in it.
Example: When I key in +12.137 and output will show exactly same.

Anyone can help plz ? thx
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Oct 20, 2009 2:40 pm     Reply with quote

I assume you are typing these characters into a terminal window on
your PC, and sending them to the PIC via RS-232.

In that case, you can use the get_float() function to get the string
and convert it to a floating point number and put it in a variable.
The get_float() function is in this file:
Quote:
c:\program files\picc\drivers\input.c

You can display the variable with the printf() function. The '-' symbol
will automatically be displayed by printf, if necessary. But to display
the '+' symbol, you'll need to check if the number is positive, and then
if so, display the '+' with printf().
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