The 9250 is a magical black box for me so I am a little scared of it :)
I was building a new Linorobot and again I found that my 9250 was not being detected. This time I was well equipped and was able to trouble shoot pretty quickly that the problem was that the code for "test connection" was not looking for the right device id:
/** Verify the I2C connection.
* Make sure the device is connected and responds as expected.
* @return True if connection is valid, false otherwise
*/
bool MPU9250::testConnection() {
uint8_t device_id = getDeviceID();
if(device_id == 0x38 || device_id == 0x71 || device_id == 0x68 || device_id == 0x39 || device_id == 0x3A)
return true;
else
return false;
}
I modified the above routine to allow for device_id == 0x3A.
But here's the thing. Why did that work? Is it even a valid fix? And then I dug deeper into code like MPU9250.cpp and saw lots of mysterious math there. And googling around I found that there are other versions of MPU9250.cpp floating around. The whole thing makes me nervous. Is that code correct? How does one gain confidence in this setup? Is there a special MPU9250.cpp for teensy 4.1?
Where can I find (or is there) an "official good" and up to date copy of that particular "driver"?