Function MPU6050 - I can not change the sensibility

I am using the MPU6050 function with the Sensor Fusion and Tracking Toolbox. I get the acceleration data, but that data is only +-2g of the amplitude sensitivity. How do I change this sensitivity? I've tried using writeRegister, but with the mpu6050 function it doesn't work. For example:
First, if I use the device function:
a = arduino('COM7', 'MEGA2560', 'Libraries', 'I2C');
sensor = device(a,'I2CAddress','0x68');
I can read ou write register, for example:
readRegister(sensor,28)
Matlab returns:
22
But, when I use the function from MPU5060:
a = arduino('COM7', 'MEGA2560', 'Libraries', 'I2C');
sensor = mpu6050(a,'I2CAddress','0x68');
So, if I try to read or write a register:
readRegister(sensor,28)
matlab shows:
Check for incorrect argument data type or missing argument in call to function 'readRegister'.
Just only I use the function device, I can write or read the register, but I don´t have the benefits from MPU6050 function and Sensor Fusion and Tracking Toolbox.
If anyone can help me, I appreciate it.
Marlon.

Answers (2)

You use read() for that, not readRegister(). See for example
Or you can use readAcceleration() or readAngularVelocity()
You cannot supply the register number; the mpu6050 object automatically supplies the register number to the arduino.
Thank you for your answer Roberson. But I would like to change the sensibility because there is no option to change it, just +-2g. Because of that, I´ve tried to write the Register. How can I change the sensibility of the accelerometer?

2 Comments

Hi,
The methods readRegister/writeRegister is not valid for mpu6050 object. Please refer to this documentation for supported properties and methods for mpu6050 object.
For additional details and assistance, please feel free to reach out to technical support.
Thanks
Gayatri
It looks to me as if you will need to configure the sensitivity using readRegister() and writeRegister() on the arduino object, before starting the mpu6050 session.

Sign in to comment.

Categories

Find more on Programming in Help Center and File Exchange

Asked:

on 25 Mar 2021

Commented:

on 26 Mar 2021

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!