フィルターのクリア

How do I bring Arduino UNO serial monitor data into MATLAB?

104 ビュー (過去 30 日間)
Victoria Smith
Victoria Smith 2021 年 3 月 31 日
回答済み: Aditya Shah 2022 年 6 月 7 日
I've been trying to take arduino uno serial monitor data and bring into into MATLAB code, but any questions online I found to help don't seem to work for mine, as I usually just get "MATLAB connection to Uno at COM3 exists in your workspace. To create a new connection, clear the existing object." when I try to pull in any data.
So far, all I can do that works is;
a = arduino('COM3','UNO');
which sets up an array in the workspace detailing all the pins it can read. I need it to print values for the A2 and A4 pins simultaneously!
Anyone have any ideas?
  1 件のコメント
Victoria Smith
Victoria Smith 2021 年 3 月 31 日
These are the values I have printed in arduino, and I need MATLAB to recieve the 1st and 3rd printed values
Serial.print(WindSpeed); Serial.print("\t\t");
Serial.print(getKnots(WindSpeed)); Serial.print("\t");
Serial.print(CalDirection);

サインインしてコメントする。

回答 (1 件)

Aditya Shah
Aditya Shah 2022 年 6 月 7 日
Hi!
Please refer to the following documentations for more information about reading streaming data from Arduino using serial communication:
  • This document explains how to enable callbacks to read streaming ASCII terminated data from Arduino® Due using the serial port interface.
  • This document explains how to use serial communication to monitor live data from Arduino Uno in MATLAB/Simulink.

カテゴリ

Help Center および File ExchangeMATLAB Support Package for Arduino Hardware についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by