Error using mpu6050 Too many input arguments. Error in line 3: imu = mpu6050(a,​'SampleRat​e',50,'Sam​plesPerRea​d',10,'Rea​dMode','La​test'); How can I solved it?

2 visualizzazioni (ultimi 30 giorni)
function [] = i2c_sensor()
a = arduino('COM3', 'UNO');
imu = mpu6050(a,'SampleRate',50,'SamplesPerRead',10,'ReadMode','Latest');
xlabel('Time (s)');
ylabel('Acceleration (m/s^2)');
title('Acceleration values from mpu6050');
hx_val = animatedline('Color','r');
hy_val = animatedline('Color','g');
hz_val = animatedline('Color','b');
for i=1:10
accelReadings(i,:) = readAcceleration(imu);
t(i)=10
display(accelReadings(i,:));
addpoints(hx_val, t(i),accelReadings(i,1));
addpoints(hy_val, t(i),accelReadings(i,2));
addpoints(hz_val, t(i),accelReadings(i,3));
drawnow
pause(1);
end
end
  2 Commenti
Walter Roberson
Walter Roberson il 3 Feb 2021
Which MATLAB release are you using? What shows up for
which mpu6050(a)
The options you are using should be valid as far back as when mpu6050 was introduced in R2019a, so it is not obvious to me why you are getting that error.

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Install Products in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by