Filter löschen
Filter löschen

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

98 Ansichten (letzte 30 Tage)
Victoria Smith
Victoria Smith am 31 Mär. 2021
Beantwortet: Aditya Shah am 7 Jun. 2022
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 Kommentar
Victoria Smith
Victoria Smith am 31 Mär. 2021
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);

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Aditya Shah
Aditya Shah am 7 Jun. 2022
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.

Kategorien

Mehr zu MATLAB Support Package for Arduino Hardware finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by