How to read serial data correctly through Matlab

前端 未结 2 1957
予麋鹿
予麋鹿 2021-01-13 13:49

I am using Matlab to read data from a serial port coming through a microprocessor. The data is in hexadecimal format with each sample of 4 bytes(32 bits). When I read this d

相关标签:
2条回答
  • 2021-01-13 14:44

    You can lower the baudrate to something more standard, like 115200.

    You can also try with a terminal program.

    0 讨论(0)
  • 2021-01-13 14:44
    serialOne=serial('COM1', 'BaudRate', 9600);
    
    fopen(serialOne);
    
    fprintf(serialOne,'textFile.txt'); <<<---this is for write  (for read, use fscanf)
    
    fclose(serialOne);
    
    0 讨论(0)
提交回复
热议问题