About serial communication and it correction
情報
この質問は閉じられています。 編集または回答するには再度開いてください。
古いコメントを表示
**At sending side****
s = serial('COM1');
set(s,'BaudRate',9600,'DataBits',8);
fopen(s);
fwrite(s,'we love you')
fclose(s)
**at receiving side****
s = serial('COM1');
set(s,'BaudRate',9600,'DataBits',8);
fopen(s);
x=fgets(s)
fclose(s)
*but at receiving only we is coming *
can you help me to get complete data at receiving side plz reply fast
0 件のコメント
回答 (1 件)
Walter Roberson
2013 年 2 月 16 日
Change to
fprintf(s,'we love you\n')
9 件のコメント
mohammad
2013 年 2 月 17 日
Walter Roberson
2013 年 2 月 17 日
I suggest you try with fgetl() instead of fgets()
mohammad
2013 年 2 月 17 日
Walter Roberson
2013 年 2 月 17 日
I wonder if you are running into a "race condition", where the data is being sent before the receiver is ready. How are you coordinating the two programs?
Do you have a "null modem cable" between the two systems? A normal serial cable would not be suitable for directly connecting two computers together.
Walter Roberson
2013 年 2 月 17 日
mohammad
2013 年 2 月 17 日
Walter Roberson
2013 年 2 月 17 日
I seem to be having difficulty finding the specifications for that device.
I am finding discussions suggesting that at least some nRF2401 use TTL level communications; if that is what is being used you would have difficulty.
mohammad
2013 年 2 月 18 日
この質問は閉じられています。
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!