Azzera filtri
Azzera filtri

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

104 visualizzazioni (ultimi 30 giorni)
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 Commento
Victoria Smith
Victoria Smith il 31 Mar 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);

Accedi per commentare.

Risposte (1)

Aditya Shah
Aditya Shah il 7 Giu 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.

Categorie

Scopri di più su MATLAB Support Package for Arduino Hardware in Help Center e File Exchange

Prodotti

Community Treasure Hunt

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

Start Hunting!

Translated by