MPU6050 Arduino Uno Simulink
74 views (last 30 days)
I have a code to get the MPU6050 working using Matlab, but now I would like to run it on Simulink, but I keep hitting dead ends. Here is my Matlab code if anyone out there can help me:
writeRegister(mpu, hex2dec('B6'), hex2dec('00'), 'int16'); %reset
for i=59:72 % 14 Data Registers for Accel,Temp,Gyro
data(j,x)= readRegister(mpu, i, 'int8');
How can I write this in SIMULINK? The loop is the easy part, I can just put it into a Matlab function block (except for readRegister)... I just can't figure out the setup part in Simulink at all. I have tryed using the I2C Read block, but to no avail. Please help. And before you ask, I do have both the Arduino packages installed (for Matlab, and Simulink).
Again Please HELP!!!