As far as I know, the “angle full” would give me the heading. For some reasons, It’s not accurate at all, actually, pretty useless. I want to calibrate the compass, but I’m stuck with it. I tried to send the commands in, but it doesn’t seem to work. Can someone help me out and tell me what’s wrong?
You are sending the wrong command (0xF6 instead of 0xF7).
From the web page:
First of all you need to enter the calibration mode by sending a 3 byte sequence of 0xF0,0xF5 and then 0xF7 to the command register, these MUST be sent in 3 separate I2C frames, you cannot send them all at once. There MUST be a minimum of 20ms between each I2C frame. The LED will then extinguish and the CMPS11 should now be rotated in all directions on a horizontal plane, if a new maximum for any of the sensors is detected then the LED will flash, when you cannot get any further LED flashes in any direction then exit the calibration mode with a command of 0xF8.
Do you receive anything on the serial monitor? If so, then it is working. Just not how you expect it to do. And the serial port should have worked or else you couldn’t upload the program to it. Though the baudrate might be set differenly. Since you have not explained what sort of microcontroller this is running on, I would like to know more about this. Evidently by the code it is an arduino of some kind. How have you connected the CMPS11 chip to it? Please show how the wires are connected, and if you have pull up resistors applied to the wires.
Yes I do receive messages on the serial monitor, but that doesn’t necessarily mean it is working properly.
I’m sorry, you are right. I should have mentioned that this is running on an Arduino UNO. You can see how I connected it to the arduino here, and yes I have pull up resistors in circuit:
Tomadevil:
Yes I do receive messages on the serial monitor, but that doesn’t necessarily mean it is working properly.
Correct. But if someone only says “it doesn’t work” without other explanation of what it IS doing, meaning any signs of life, then we have to assume even the worst of conditions are possible. That the microcontroller is dead or damaged, has a power supply failure or short in it’s supply circuit, is in a reset-state, or got itself locked in a program state without ever having done any change to it’s GPIO pins. A full explanation of it’s behaviour is essential in locating the source of an issue. “doesn’t work” doesn’t help.
I’m sorry, you are right. I should have mentioned that this is running on an Arduino UNO. You can see how I connected it to the arduino here, and yes I have pull up resistors in circuit: