Skip to content

Commit

Permalink
Merge pull request #15 from mayankgour13/patch-1
Browse files Browse the repository at this point in the history
Typecasting added to support 32-bit controllers.
  • Loading branch information
jarzebski authored May 18, 2023
2 parents 940449c + 8103468 commit 6617360
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions MPU6050.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,9 +373,9 @@ Vector MPU6050::readRawAccel(void)
uint8_t zla = Wire.receive();
#endif

ra.XAxis = xha << 8 | xla;
ra.YAxis = yha << 8 | yla;
ra.ZAxis = zha << 8 | zla;
ra.XAxis = (int16_t)(xha << 8 | xla);
ra.YAxis = (int16_t)(yha << 8 | yla);
ra.ZAxis = (int16_t)(zha << 8 | zla);

return ra;
}
Expand Down Expand Up @@ -434,9 +434,9 @@ Vector MPU6050::readRawGyro(void)
uint8_t zla = Wire.receive();
#endif

rg.XAxis = xha << 8 | xla;
rg.YAxis = yha << 8 | yla;
rg.ZAxis = zha << 8 | zla;
rg.XAxis = (int16_t)(xha << 8 | xla);
rg.YAxis = (int16_t)(yha << 8 | yla);
rg.ZAxis = (int16_t)(zha << 8 | zla);

return rg;
}
Expand Down

0 comments on commit 6617360

Please sign in to comment.