16-bit signed binary to binary coded decimal(BCD) ascii

Deirdre Hackett dhackers at mail.com
Thu Feb 13 14:00:52 EST 2003


Hi,
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)
Thanks,
Deirdre  

-- 
__________________________________________________________
Sign-up for your own FREE Personalized E-mail at Mail.com
http://www.mail.com/?sr=signup






More information about the Python-list mailing list