Reading MPU-6050 in Matlab

조회 수: 4 (최근 30일)
Mateusz Borejko
Mateusz Borejko 2017년 3월 30일
답변: Aravind 2025년 5월 16일
How to read real-time data from MPU-6050 connected to Storm32 Gimbal Controller in Matlab/Simulink?

답변 (1개)

Aravind
Aravind 2025년 5월 16일
The Storm32 Gimbal Controller supports serial communication, and its documentation provides details on the output format and available commands.
You can read sensor data from the Storm32 Gimbal Controller in MATLAB by connecting it to your PC and identifying the serial port it is using. To establish a connection to this serial port in MATLAB, use the "serial" function if you are working with MATLAB R2019a or earlier. For MATLAB R2019b and later, it is recommended to use the "serialport" function, as the "serial" function is being deprecated.
For documentation on the "serial" function in older MATLAB versions, you can enter the following command in the MATLAB command window:
doc serial
For the documentation on the "serialport" function for newer MATLAB versions, see: https://www.mathworks.com/help/matlab/ref/serialport.html.
You may also find this example helpful for using the "serialport" interface to communicate over a serial connection: https://www.mathworks.com/help/matlab/import_export/read-streaming-data-from-arduino.html.
Once the serial connection is open, you can send and receive data through it. Refer to the Storm32 Gimbal Controller's documentation for the correct commands to send and for parsing the received responses to obtain the sensor data you need.
I hope this answers your question.

Community Treasure Hunt

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

Start Hunting!

Translated by