[MPU6050] Support devices with WHOAMI 0x98 (#3784)

This commit is contained in:
Carlos Garcia Saura 2022-09-12 00:32:07 +02:00 committed by GitHub
parent 9a5f865eea
commit be473b97c4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -23,7 +23,7 @@ const float GRAVITY_EARTH = 9.80665f;
void MPU6050Component::setup() {
ESP_LOGCONFIG(TAG, "Setting up MPU6050...");
uint8_t who_am_i;
if (!this->read_byte(MPU6050_REGISTER_WHO_AM_I, &who_am_i) || who_am_i != 0x68) {
if (!this->read_byte(MPU6050_REGISTER_WHO_AM_I, &who_am_i) || (who_am_i != 0x68 && who_am_i != 0x98)) {
this->mark_failed();
return;
}