Fix MPU-6500 cannot connect (#173)

This commit is contained in:
Inku Xuan
2022-07-04 05:45:57 +08:00
committed by GitHub
parent 61b94b97b0
commit fcbd4ff911

View File

@@ -67,7 +67,12 @@ void MPU6050::initialize(uint8_t address) {
*/
bool MPU6050::testConnection() {
uint8_t deviceId = getDeviceID();
return deviceId == 0x68 || deviceId == 0x70 || deviceId == 0x71 || deviceId == 0x73; // Allow any MPUs
// 0x68 -> MPU-6050
// 0x70 -> MPU-6500
// 0x71 -> MPU-9250
// 0x73 -> MPU-9255
// 0x74 -> MPU-6515
return deviceId == 0x68 || deviceId == 0x70 || deviceId == 0x71 || deviceId == 0x73 || deviceId == 0x74;
}
// AUX_VDDIO register (InvenSense demo code calls this RA_*G_OFFS_TC)