Shop OBEX P1 Docs P2 Docs Learn Events
reading the HM55B electronic compass — Parallax Forums

reading the HM55B electronic compass

abdelrazzac10abdelrazzac10 Posts: 4
edited 2007-05-22 12:46 in BASIC Stamp
hi,
I'm trying to read data from an HM55B electronic compass... the problem is that I'm using the serial port to communicate with the computer so I have to write the sensor program using different pins... well I have written the program, and I'm getting data, but my problem starts here... I'm reading x and y data, (as 11 bits), I'm testing the 10th bit, if it's 1 I'm masking data with "1111100000000000", I'm then sending this data to the computer where I'm calculating arctan(-y/x)... the problem is that I'm getting strange values in the computer, the values are always changing between 45-63-71-83-89 and their negative values... but not in linear form... the value starts by 45 then does directily to 63 then 71-83 and 89.... it seems as the sensor is not sensitive.. is it because of the noise? is it a false step I have done???

if you have any experience please share it with me... I have to finish this project as soon as possible....

thank you a lot....

Comments

  • WynandWynand Posts: 39
    edited 2007-05-22 12:46
    Did you try to run the demo program? (Attached below) Did it give you the same response? Are all your wires connected correctly? illy questions I know, but a loose connection has given me days of grief and headache!!!!!!!! Also, make ure that there no electrical wires and no magnetical inerference, because the chip is very sensitive......

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Why didn't I think of THAT!!!!
Sign In or Register to comment.