Connect to MPU-6050 sensor on Raspberry Pi hardware I2C bus
The mpu6050 object reads linear acceleration and angular velocity
along the X, Y, and Z axes using the InvenSense I2C-based MPU-6050 inertial measurement unit
(IMU) sensor interfaced with the Raspberry Pi™ hardware. This object represents a connection from MATLAB® to the MPU-6050 sensor connected on the Raspberry Pi hardware board I2C pins I2C1_SDA (GPIO 2) and I2C1_SCL (GPIO 3). Before you use
the mpu6050 object, ensure that the I2C interface is enabled on your
Raspberry Pi kernel. You can then create a connection to the Raspberry Pi board using the raspi object and set its properties. For more
information, see enableI2C and raspi.
creates a MPU-6050 sensor object with default property values. The object represents a
connection to the sensor on the Raspberry Pi hardware sensor = mpu6050(mypi)mypi.
creates a MPU-6050 sensor object with properties using one or more
sensor = mpu6050(mypi,Name,Value)Name,Value arguments.
readAcceleration | Read one acceleration data sample from MPU-6050 sensor |
readAngularVelocity | Read one angular velocity data sample from MPU-6050 sensor |
disableI2C | enableI2C | Raspberry Pi Resource
Monitor App | raspi | readAcceleration | readAngularVelocity | scanI2CBus | showPins