What read() function with <<1,'uint8'>> arguments returns afterall?
이전 댓글 표시
I'm trying to read data from a serial port.
So, my code is something like this:
ser = serialport('COM2',2400);
ser.DataBits = 8;
ser.StopBits = 1;
ser.ByteOrder = 'big-endian';
data = read(ser,1,'uint8');
My Question: What data type 'data' is?
From what I thought it would be an unsigned integer from 0 to 128.
But then when I make de2bi(data) it shows an error saying: "Error using bi2de>validateInputs (line 44). Expected input number 1, binary vector b, to be nonempty.".
Is perahps read() function returning some kind of data array?!
Thanks for help!
댓글 수: 1
Walter Roberson
2020년 1월 9일
The read() is not returning any data.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Serial and USB Communication에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!