필터 지우기
필터 지우기

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 CenterFile Exchange에서 MATLAB 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