Jan Noman
Joined: 28 May 2005 Posts: 14
|
very strange math solution |
Posted: Sat Aug 06, 2005 6:59 am |
|
|
HI everybody !
cod:
I send A=1,B=2,C=3,D=4,E=5 by transciver
........
putc(A);
....................
putc(E);
.......................
receive:
.....................
int16 value;
int A,B,C,D,E,sign;
while(TRUE)
{
sign=getc();
if(sign==85){
A=getc();
B=getc();
c=getc();
D=getc();
E=getc();
}
lcd_gotoxy(1,1);
printf(lcd_putc,"\f\%U%U%U%U%U",A,B,C,D,E);
in this case all work very good
value on LCD= 12345
but in this case
value = A*10000+B*1000+C*100+D*10+E;
lcd_gotoxy(1,1);
printf(lcd_putc,"\f\%05lu",value);
value on LCD =12089 WHY ?
Best Regards
Jan |
|