Skip to content

Commit

Permalink
modified register begin sequence (Issue #1)
Browse files Browse the repository at this point in the history
  • Loading branch information
rfetick committed Jan 24, 2021
1 parent da7a8bd commit 907b01e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,5 @@ See the LICENSE file
[rfetick](https://github.com/rfetick) : modifications for better memory management, speed and efficiency.

[tockn](https://github.com/tockn) : initial author of the library (v1.5.2)

The library has also been improved thanks to the comments of [edgar-bonet](https://github.com/edgar-bonet) and [augustosc](https://github.com/augustosc)
3 changes: 2 additions & 1 deletion src/MPU6050_light.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ MPU6050::MPU6050(TwoWire &w){
}

byte MPU6050::begin(int gyro_config_num, int acc_config_num){
// changed calling register sequence [https://github.com/rfetick/MPU6050_light/issues/1] -> thanks to augustosc
byte status = writeData(MPU6050_PWR_MGMT_1_REGISTER, 0x01); // check only the first connection with status
writeData(MPU6050_SMPLRT_DIV_REGISTER, 0x00);
writeData(MPU6050_CONFIG_REGISTER, 0x00);
setGyroConfig(gyro_config_num);
setAccConfig(acc_config_num);
byte status = writeData(MPU6050_PWR_MGMT_1_REGISTER, 0x01); // check only the last connection with status

this->update();
angleX = this->getAccAngleX();
Expand Down

0 comments on commit 907b01e

Please sign in to comment.