16-bit signed binary to binary coded decimal(BCD) ascii
dhackers at mail.com
Thu Feb 13 20:00:52 CET 2003
I want to take in data in binary format from a magnetometer.
The magnetometer sends out the x,y,and z components of the magnetic field.
The order of output for the binary format is:
Xhi, Xlo, Yhi, Ylo, Zhi, Zlo.
The binary format is more efficient since only 7 bytes are transmitted as opposed to BCD ascii where 28 bytes are transmitted.
However at some point i want to be able to view these readings that i have taken in.
After all that long-winded babble, my question is how can i convert the 16-bit binary information into BCD ascii, which is easier for user interpretation.
There must be a simple way to do or maybe even someone has written there own module to do it.
Please keep it simple.
I am not an expert.(As if you couldn't tell)
Sign-up for your own FREE Personalized E-mail at Mail.com
More information about the Python-list