I am working on one project where I am using serial communication. I have used your code from Serial Input Basics - Example 3. I have one problem here is output from my serial monitor.
<Arduino is ready>
0
0
0
0
This just in ... 43*20*36*45
43
20
36
45
This just in ... 43*20*1023*45
43
20
1022
45
This just in ... 43*20*26*45
43
20
26
45
This just in ... 43*20*2<43*20*1656*45
3241
20
1654
45
This just in ... 42**20*481*45
0
20
480
45
This just in ... 42*
<42*20*481*45<43*20*244*45
-19296
20
243
45
This just in ... 43*20*1445
0
43
20
1443
This just in ... 42*20*480*4<43*20*481*45
5241
20
480
45
This just in ... 43*20*481*45
43
20
480
45
This just in ... 43<42*20*1643*45<43*20*1661*45
-19296
20
1659
45
first three are correctly received but other no. What cause this ?
At 9600 baud, you're sending roughly a character per millisecond at an extremely high repetition rate. Your receiver side can not keep up with that and you're filling the software receive buffer and it will eventually be full. Any data received after that is discarded till there is space.
Slow down the sender (add e.g. delay(500) for testing purposes at the end of the sender's loop().
Note:
marcopinter999:
Hi
I am working on one project where I am using serial communication. I have used your code from Serial Input Basics - Example 3. I have one problem here is output from my serial monitor.
<Arduino is ready>
0
0
0
0
This just in ... 43203645
43
20
36
45
This just in ... 4320102345
43
20
1022
45
This just in ... 43202645
43
20
26
45
This just in ... 43202<4320165645
3241
20
1654
45
This just in ... 42**2048145
0
20
480
45
This just in ... 42*
<422048145<432024445
-19296
20
243
45
This just in ... 43201445
0
43
20
1443
This just in ... 42204804<432048145
5241
20
480
45
This just in ... 432048145
43
20
480
45
This just in ... 43<4220164345<43201661*45
-19296
20
1659
45
first three are correctly received but other no. What cause this ?
Actually, the second one is already incorrect (1023 versus 1022); typing mistake?
@marcopinter999, please be kind enough to change the name of this Thread so that other people searching for my tutorials will not be confused. If you modify your Original Post you can edit the title. Perhaps just add " question" to the end of your title.