rfetick / MPU6050_light

Lightweight, fast and simple library to communicate with the MPU6050
MIT License
126 stars 36 forks source link

Added new register switching function to allow for multiple sensors. #13

Closed ghost closed 2 years ago

ghost commented 3 years ago

This modification was made off of the Arduino library function so some more recent features may not be available for it. This small tweak allows for a the reading register to be switched from 0x68 to 0x69. To switch your MPU_6050 board to register 0x69 just set the AD0 pin to HIGH then to switch back set it to 0x68, set AD0 to LOW. This allows for a register swap, so if you only want 1 sensor the library is still the same but if you want 2 or more, you can follow the following protocol: Call MPU6050::switchReadingAddress() For all of the sensors, set their AD0 pins to LOW Now the system is set up, you can now set a specific sensor to read from To read from sensor "x", just set sensor "x"'s AD0 pin to HIGH

To re-enter single sensor mode just re-call MPU6050::switchReadingAddress()

rfetick commented 2 years ago

No answer from the person who opened the pull request. I close it now.