I am currently coding for my inverted pendulum. I am using the MPU6050 and I am confused as how to exactly read the data from the sensor. I am obviously using Jeff Rowbergs I2C library, and I ran his example sketch on the uno and it works perfectly. But now I’m trying to take a single sensor reading from the mpu6050 and store it in a variable that I can use to put in my PID control.
How do I take one reading from the sensor and store it as a variable? Never used I2C before.
intialize_senior_project.ino (7.15 KB)