The CMPS12 is a great compass. When I am running it on an arduino, I get great, solid, continuous results. But mounted on a robot, it boots up at 358 degrees EVERY time. I have tried to delete the cal profile to see if it needs to recalibrate for the bot, but am unsuccessful. Here is the code:
}
with reset numbers from the data sheet. This is a the way the CMPS11 was calibrated, but with the CMPS12 write numbers.
Calibration register reads a “3” [fully calibrated] all the time, even after the above function is run.
The chip is mounted above the bot, but it was mounted right on the Arduino board without problems. I can’t find example code except for the one sketch by James Henderson [2014].
Does anyone have access to more info on this chip?
delay(20); // 20ms delay after each of the three bytes send
Wire.beginTransmission(_address);
Wire.write(0x00);
Wire.write(0xE5);
_last_status = Wire.endTransmission();
delay(20); // 20ms delay after each of the three bytes send
Wire.beginTransmission(_address);
Wire.write(0x00);
Wire.write(0xE2);
_last_status = Wire.endTransmission();
delay(20); // 20ms delay after each of the three bytes send