Need help with serial communication in matlab
Info
This question is closed. Reopen it to edit or answer.
Show older comments
Hi all,
I recently started a project with some friends of mine to make an RGB LED-cube. This is a really fun project, and now I want to write a simulator for this cube. A friend of mine made a C program to communicate between our Windows PCs and the Arduino powering the cube. I thought it would be fairly easy to intercept the information sent through the serial ports with Matlab and a program that makes a virtual bridge between 2 comports on a computer.
This is the planned setup: Laptop sends information to (for example) com3 Virtual comport program intercepts com3 and outputs everything to com4 Matlab opens com4 and reads and processes the information sent.
This should work as far as I know, but for some reason matlab isn't able to communicate with the com4 port. I can open the port, and change some parameter, but the BytesAvailable option of the Serial object always stays 0, so I can not read anything...
I would love to hear from you.
Thanks in advance!
Job
Ps. On http://ul.to/7ov6z6sh you can download the source code and the compiled serial communication program in C, so you could test it for yourself.
Pss. For serial communication, I just use:
s = serial('com4');
s_open = fopen(s);
output = fscanf(s); % or fscanf(s, '%s');
which timeouts.
Answers (0)
This question is closed.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!