el codigo en el que estoy trabajando debe leer datos en tiempo real de arduino

조회 수: 7 (최근 30일)
Frida Isabel
Frida Isabel 2023년 11월 19일
답변: the cyclist 2023년 11월 19일
The code gives me an error in the following section:
% Configuración de la conexión serie
puerto_serie = serialport('COM4', 'BaudRate',9600);
configureTerminator(puerto_serie, "LF");
the error it gives me is:
Error using serialport
Expected input number 2, BAUDRATE, to be one of these types:
double
Error in visualizacionmatlab (line 3)
puerto_serie = serialport('COM4', 'BaudRate',9600);
I cannot identify where the fault is, because I am using the functions that the serialport returns
  댓글 수: 1
Torsten
Torsten 2023년 11월 19일
You should use the google translator spanish -> english to make answering easier for the community.
Deberías utilizar el traductor de google español -> inglés para facilitar la respuesta a la comunidad.

댓글을 달려면 로그인하십시오.

답변 (1개)

the cyclist
the cyclist 2023년 11월 19일
See this example from the documentation for serialport:
s = serialport("COM3",9600,"Timeout",5);
data = read(s,16,"uint32");
You should be writing
serialport('COM4', 9600);
instead of
serialport('COM4', 'BaudRate',9600);
In other words, the baud rate is a direct input, not a "Name-Value" input.

카테고리

Help CenterFile Exchange에서 Serial and USB Communication에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by