reading the HM55B electronic compass
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....
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Why didn't I think of THAT!!!!