Skip to main content
Arduino

Return to Answer

replaced http://arduino.stackexchange.com/ with https://arduino.stackexchange.com/
Source Link

Your problem here is that you are streaming out serial data non-stop.

See my answer in this thread: What is Serial.begin(9600)? What is Serial.begin(9600)?

Without having a pause, the receiver just latches onto somewhere in the middle of the data stream and tries to make sense of it, often unsuccessfully.

If you add one "character time" delay to the sender, the receiver works fine:

 altSerial.print('1');
 delay (2);

It might get the first one wrong, but now the receiver has 2 ms to resynchronize on the data stream. At 9600 baud the delay should be 1/960 (second) at least, I used twice that to be sure.

Your problem here is that you are streaming out serial data non-stop.

See my answer in this thread: What is Serial.begin(9600)?

Without having a pause, the receiver just latches onto somewhere in the middle of the data stream and tries to make sense of it, often unsuccessfully.

If you add one "character time" delay to the sender, the receiver works fine:

 altSerial.print('1');
 delay (2);

It might get the first one wrong, but now the receiver has 2 ms to resynchronize on the data stream. At 9600 baud the delay should be 1/960 (second) at least, I used twice that to be sure.

Your problem here is that you are streaming out serial data non-stop.

See my answer in this thread: What is Serial.begin(9600)?

Without having a pause, the receiver just latches onto somewhere in the middle of the data stream and tries to make sense of it, often unsuccessfully.

If you add one "character time" delay to the sender, the receiver works fine:

 altSerial.print('1');
 delay (2);

It might get the first one wrong, but now the receiver has 2 ms to resynchronize on the data stream. At 9600 baud the delay should be 1/960 (second) at least, I used twice that to be sure.

Source Link
Nick Gammon
  • 38.9k
  • 13
  • 69
  • 125

Your problem here is that you are streaming out serial data non-stop.

See my answer in this thread: What is Serial.begin(9600)?

Without having a pause, the receiver just latches onto somewhere in the middle of the data stream and tries to make sense of it, often unsuccessfully.

If you add one "character time" delay to the sender, the receiver works fine:

 altSerial.print('1');
 delay (2);

It might get the first one wrong, but now the receiver has 2 ms to resynchronize on the data stream. At 9600 baud the delay should be 1/960 (second) at least, I used twice that to be sure.

lang-cpp

AltStyle によって変換されたページ (->オリジナル) /