Borrar filtros
Borrar filtros

Serial port to mathlab

1 visualización (últimos 30 días)
Andy Bruot
Andy Bruot el 10 de Mayo de 2022
Respondida: Bhanu Prakash el 11 de Oct. de 2023
J'ai accés à Mathlab depuis un acces virtuel depuis mon université, je n'ai donc pas la licence de Mathlab mais je peux l'utiliser.
Mais j'ai un travail à faire dans le cadre de mes études. Et pour cela je dois utiliser un serial port pour mon programme, or il le port ne marche pas, est-ce qu'il s'agit du fait que j'ai acces à Mathlab via mon université ?
Pouvez-vous m'aider si vous en savez quelque chose ou si vous savez comment remédier à ce problème.

Respuestas (1)

Bhanu Prakash
Bhanu Prakash el 11 de Oct. de 2023
Hi Andy,
As per my understanding, you are facing issues with using a serial port from MATLAB.
You can connect to a serial port with the help of theserialport’ function in MATLAB. To establish a connection, the arguments ‘port’ (serial port name) and baudrate are to be passed to the function, as mentioned in the code statement below:
s= serialport(port,baudrate)
Please note that the target hardware must be connected to your device to establish the connection using the serialport’ function.
Once the connection is established, data can be written to or read from the serial port by using the ‘write’ and ‘read’ object functions respectively.
For more information on the ‘serialport’ function, please refer to the following documentation:

Etiquetas

Community Treasure Hunt

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

Start Hunting!