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

ascii & int

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








ascii & int
PostPosted: Mon Dec 10, 2007 12:35 am     Reply with quote

Hi;
I used pic 16F877A.
I want to calculate all operators maths(+,-,*,/)
But when I receive 2 int from pc, int values are ascii value not int.
I recognize int to int so my getc must take int values....

Int a,b,result;
a=getc();
b=getc();
result=a+b;//

//result is not a+b int
The value is ascii a plus ascii b
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 10, 2007 1:42 am     Reply with quote

Look at the gethex1() function in this CCS file:
Quote:
c:\Program Files\picc\Drivers\input.c

This function gets a single ascii digit from the serial port and converts
it to a binary integer.
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