user70196: I get two 10-bit values from analog pins. These two values in a string, ";" combine with.
for ex:  515; 510
I am sending it to another arduino via Serial.print. I cannot display this string expression on other arduino's serial monitor. But when I press the reset button of Coordinator arduino, there are a few values. Can you help me?
My Coordinator Code:
#include <SoftwareSerial.h>
#define xBeeRxPin 10
#define xBeeTxPin 9
int deger3;
int deger4;
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);

void setup() { 
  //Serial.begin(9600);
  xBeeSerial.begin(38400);
  }void loop() {
     
    deger3 = analogRead(A0);
    deger4 = analogRead(A2);
  
    String deger5 = " " + (String)deger3 + ";" + (String)deger4 ;
    
    Serial.println("string ifade: " + deger5);
  
    xBeeSerial.print(deger5);
  }

My Receiver Code:
#include <SoftwareSerial.h>
#define xBeeRxPin 10
#define xBeeTxPin 9
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);
String d1;

void setup() {
  xBeeSerial.begin(38400);
  Serial.begin(38400);
}
void loop() {
  if(xBeeSerial.available()){
    d1=xBeeSerial.readString();
    Serial.print(d1);
  }
}


user4143: There is a fundamental problem with your communication strategy, and that is you have nothing to tell the receiver "This is the end of a message".
You are sending a constant stream of
 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510.....

and the receiver really doesn't know what to make of that.
This is because you are using the function .readString() at the receiver. This will blindly receive characters and store them in the target string up until the point those characters stop arriving. And that happens only after a break of at least 1 second in transmission. That never comes. So never ends. That is, until you reset the sender and it sees that break in transmission.
It's a very crude function and I'd never recommend anyone ever using it for anything.
Instead you need to break your transmission up into separate lines with .println() or appending \n to the string.  Then you can use .readStringUntil('\n') to get each line in turn and display it.
Also, on a side note, you really shouldn't be appending all your data to a string then sending the string, that's completely redundant. Just send each individual part of the data as separate prints. All you're achieving with all that String manipulation is to fragment your heap and cause your code to be unstable.

user70196: I obtained the values ​​I wanted and performed the separation. I am sending a list of joystick positions via the serial connection to the arduino in the following format
515;520
Which would be parsed as:
x=515
y=520
MyCoordinator:
#include <SoftwareSerial.h>
#define xBeeRxPin 10
#define xBeeTxPin 9
int deger3;
int deger4;
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);

void setup() { 
  Serial.begin(38400);
  
}void loop() {
  xBeeSerial.begin(38400); 
  deger3 = analogRead(A0);
  deger4 = analogRead(A2);
  
  String deger5 =  (String)deger3 + ";" + (String)deger4 ;
  Serial.println("string ifade: " + deger5);

  xBeeSerial.println(deger5);
  
  delay(200);
}

MyReceiver:
#include <SoftwareSerial.h>
#define xBeeRxPin 10
#define xBeeTxPin 9
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);
String d1,d2,d3;

void setup() {
  xBeeSerial.begin(38400);
  Serial.begin(38400);
}
void loop() { 
  if(xBeeSerial.available()>0){
    d1=xBeeSerial.readStringUntil('\n');
    //Serial.print(d1);
    d2 = d1.substring(0,d1.indexOf(59));
    d3 = d1.substring(d1.indexOf(59)+1);
    Serial.println("x ekseni: " + d2);
    Serial.println("y ekseni: " + d3);
  }  
}


70196: <p>I get two 10-bit values from analog pins. These two values in a string, &quot;;&quot; combine with.</p>
<p>for ex:  515; 510</p>
<p>I am sending it to another arduino via Serial.print. I cannot display this string expression on other arduino's serial monitor. But when I press the reset button of Coordinator arduino, there are a few values. Can you help me?</p>
<p>My Coordinator Code:</p>
<pre><code>#include &lt;SoftwareSerial.h&gt;
#define xBeeRxPin 10
#define xBeeTxPin 9
int deger3;
int deger4;
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);

void setup() { 
  //Serial.begin(9600);
  xBeeSerial.begin(38400);
  }void loop() {
     
    deger3 = analogRead(A0);
    deger4 = analogRead(A2);
  
    String deger5 = &quot; &quot; + (String)deger3 + &quot;;&quot; + (String)deger4 ;
    
    Serial.println(&quot;string ifade: &quot; + deger5);
  
    xBeeSerial.print(deger5);
  }
</code></pre>
<p>My Receiver Code:</p>
<pre><code>#include &lt;SoftwareSerial.h&gt;
#define xBeeRxPin 10
#define xBeeTxPin 9
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);
String d1;

void setup() {
  xBeeSerial.begin(38400);
  Serial.begin(38400);
}
void loop() {
  if(xBeeSerial.available()){
    d1=xBeeSerial.readString();
    Serial.print(d1);
  }
}
</code></pre>
 4143: <p>There is a fundamental problem with your communication strategy, and that is you have nothing to tell the receiver &quot;This is the end of a message&quot;.</p>
<p>You are sending a constant stream of</p>
<pre><code> 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510 515; 510.....
</code></pre>
<p>and the receiver really doesn't know what to make of that.</p>
<p>This is because you are using the function <code>.readString()</code> at the receiver. This will blindly receive characters and store them in the target string up until the point those characters stop arriving. And that happens only after a break of at least 1 second in transmission. That never comes. So never ends. That is, until you reset the sender and it sees that break in transmission.</p>
<p>It's a very crude function and I'd never recommend anyone ever using it for anything.</p>
<p>Instead you need to break your transmission up into separate lines with <code>.println()</code> or appending <code>\n</code> to the string.  Then you can use <code>.readStringUntil('\n')</code> to get each line in turn and display it.</p>
<p>Also, on a side note, you really shouldn't be appending all your data to a string then sending the string, that's completely redundant. Just send each individual part of the data as separate prints. All you're achieving with all that String manipulation is to fragment your heap and cause your code to be unstable.</p>
 70196: <p>I obtained the values ​​I wanted and performed the separation. I am sending a list of joystick positions via the serial connection to the arduino in the following format</p>
<p>515;520</p>
<p>Which would be parsed as:</p>
<p>x=515</p>
<p>y=520</p>
<p><em><strong>MyCoordinator:</strong></em></p>
<pre><code>#include &lt;SoftwareSerial.h&gt;
#define xBeeRxPin 10
#define xBeeTxPin 9
int deger3;
int deger4;
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);

void setup() { 
  Serial.begin(38400);
  
}void loop() {
  xBeeSerial.begin(38400); 
  deger3 = analogRead(A0);
  deger4 = analogRead(A2);
  
  String deger5 =  (String)deger3 + &quot;;&quot; + (String)deger4 ;
  Serial.println(&quot;string ifade: &quot; + deger5);

  xBeeSerial.println(deger5);
  
  delay(200);
}
</code></pre>
<p><em><strong>MyReceiver:</strong></em></p>
<pre><code>#include &lt;SoftwareSerial.h&gt;
#define xBeeRxPin 10
#define xBeeTxPin 9
SoftwareSerial xBeeSerial(xBeeRxPin, xBeeTxPin);
String d1,d2,d3;

void setup() {
  xBeeSerial.begin(38400);
  Serial.begin(38400);
}
void loop() { 
  if(xBeeSerial.available()&gt;0){
    d1=xBeeSerial.readStringUntil('\n');
    //Serial.print(d1);
    d2 = d1.substring(0,d1.indexOf(59));
    d3 = d1.substring(d1.indexOf(59)+1);
    Serial.println(&quot;x ekseni: &quot; + d2);
    Serial.println(&quot;y ekseni: &quot; + d3);
  }  
}
</code></pre>
