Sourced from Arduino Playground. See https://playground.arduino.cc/Main/MPU-6050 for more information.
Code referenced in Accelerometer tutorial: https://www.arrow.com/en/research-and-events/articles/arduino-accelerometer-tutorial-adding-input-to-your-project