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
Posted: Mon Dec 10, 2007 1:42 am
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.
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