FOR TIPS, gUIDES & TUTORIALS

subscribe to our Youtube

GO TO YOUTUBE
Ask a question

3723 questions

4243 answers

3160 comments

40694 members

Ask a question
0 votes
169 views
in Vehicle tracking by
I cannot correctly calculate this coordinate. the coordinate -6.97028 approx. 

1 Answer

0 votes
by

Hello,

To determine if the coordinate is negative, convert it to binary format and check the very first bit. If it is 0, coordinate is positive, if it is 1, coordinate is negative.

Example:
Received value: 20 9C CA 80 converted to BIN: 00100000 10011100 11001010 10000000 first bit is 0, which means coordinate is positive converted to DEC: 547146368. For more information see two‘s complement arithmetic.

3F 3F 78 63 gives 00111111 00111111 01111000 01111000 which is 1061124195 in decimal.

by

how calculate -6,98847? if send 3F 3F 78 63

000000000000003308010000017E3F3F0D41003F3F7E3F172E3F3F003F00000F000000060416013F0115043F0100023F00027D023F613F3F3F000100006C7A

by 1 flag
Please provide whole data packet
by
my function is wrong, thank