How can I use the serialport command to read ASCII data from an M5Stick-C
5 ビュー (過去 30 日間)
古いコメントを表示
Hi! I am trying to read a stream of data from an M5Stick-C through the serial port. I am using the following command
device = serialport('COM4', 115200);
I have the M5Stick configured to display the data at one of its analog read pins on its LCD, so I can tell when data is being sent. Unfortunately, when I run that command in matlab, the M5Stick seems to freeze and the values no longer update on its screen. Then using the command
readline(device);
this error is thrown, "Warning: The specified amount of data was not returned within the Timeout period for 'readline'. 'serialport' unable to read any data. For more information on possible reasons, see serialport Read Warnings."
I have a terminating character configured as well and Im pretty sure all of the serial port setting are the same for both devices.
Is there any reason why createing a setting up the port in matlab has this effect? Note this does not happen when I used the outdated command
device = serial('COM4', 'BAUD', 115200);
0 件のコメント
回答 (0 件)
参考
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!