xbee pro 528 fastest settings?

i have a remote control car im using two xbees to control one as router and one as cordinator. i interested in what everyone one thinks the best settings would be to have the fastest communication? i can post my arduino code if needed

i interested in what everyone one thinks the best settings would be to have the fastest communication?

There is a baud rate that the Arduino uses to talk to the XBee. Faster is, obviously, better.

There is a baud rate that one XBee uses to talk to the other XBee(s). Faster is, obviously, better.

There are addressing modes involved in one XBee talking to another XBee. Using broadcast mode is slow. Obviously, you don't want to use that mode.

There is a baud rate that the second XBee uses to talk to the second Arduino. Faster is, obviously, better.

Then there is the matter of how much data you send, and when you send it. Sending more data, obviously, takes longer.

i can post my arduino code if needed

Only if you want to. If hand-waving answers are fine, you don't need to.

thank you paul. i came across an old post where you talked about the DH, Dl matching the SH,SL on both and i made those changes. i have one as cordinator and one as router i change the baud rate back to 9600 it was set on 57600 but seems to run better on 9600.

Can I send information back to the to xbee?

Can I send information back to the to xbee?

To the XBee? Or through the XBee? The answer to both is yes. How it is done is different.

i want to send info to the xbee on the car then get a return response to verify its still connected

merkzilla:
i want to send info to the xbee on the car then get a return response to verify its still connected

As opposed to getting a reply from the Arduino that the XBee is connected to?

Yes I'm sorry for not specifying. I would like to send it through the xbee to the arduino then back to the other arduino through the xbee.

merkzilla:
Yes I'm sorry for not specifying. I would like to send it through the xbee to the arduino then back to the other arduino through the xbee.

So, what is the problem?

How are the XBees connected to the Arduinos?

I guess I want to know if I just serial read on the tx side like I do on the rc car side for any serial print from the car?

merkzilla:
I guess I want to know if I just serial read on the tx side like I do on the rc car side for any serial print from the car?

Yes, assuming that the car side uses print() or write() to send data.

im having some trouble here i cant seem to get a response from the arduino in the car and also when i push “start” it serial prints “sending start” but my lcd does not clear it looks like its trying to lcd print “no connection push start” and also “connecting please wait” at the same time. but my main issue is the comunication between the two. i know on my micro that ist he controller i had to use Software serial so im assuming id still have to use that when serial reading.

// Receive with start- and end-markers combined with parsing
#include <Servo.h>
Servo SteerServo, MotorServo, CamServoC, CamServoD;
const byte numChars = 32;
char receivedChars[numChars];
char tempChars[numChars];        
char messageFromTX[numChars] = {0};

int ServoA = 0;
int ServoB = 0;
int ServoC = 0;
int ServoD = 0;

boolean newData = false;
boolean Connection = false;
//============
void setup() {
  
    Serial.begin(9600);
     CamServoC.attach(5);
     SteerServo.attach(6);
  MotorServo.attach(7);
 //Enter data in this style <text,12,24.7> 
}

//============

void loop() {
    if(Connection == false)
    {
    recvWithEndMarker();
    CheckConnection();
    }
    
    else{
      
    recvWithStartEndMarkers();
    
    if (newData == true) { 
        strcpy(tempChars, receivedChars);
            // this temporary copy is necessary to protect the original data
            //   because strtok() replaces the commas with \0
        parseData(); 
        delay(10);
        showParsedData();
        movement();
        newData = false;
    }
    }
}

//============

void recvWithStartEndMarkers() {
    static boolean recvInProgress = false;
    static byte ndx = 0;
    char startMarker = '<';
    char endMarker = '>';
    char rc;

    while (Serial.available() > 0 && newData == false) {
        rc = Serial.read();
Serial.print(rc);
        if (recvInProgress == true) {
            if (rc != endMarker) {
                receivedChars[ndx] = rc;
                ndx++;
                if (ndx >= numChars) {
                    ndx = numChars - 1;
                }
            }
            else {
                receivedChars[ndx] = '\0'; // terminate the string
                recvInProgress = false;
                ndx = 0;
                newData = true;
            }
        }

        else if (rc == startMarker) {
            recvInProgress = true;
        }
    }
}

//============

void parseData() {

      // split the data into its parts
    char * strtokIndx; // this is used by strtok() as an index

    strtokIndx = strtok(tempChars,",");      // get the first part - the string
    strcpy(messageFromTX, strtokIndx); // copy it to messageFromPC
  
    strtokIndx = strtok(NULL, ","); // this continues where the previous call left off
    ServoA = atoi(strtokIndx);     // convert this part to an integer

    strtokIndx = strtok(NULL, ",");
    ServoB = atoi(strtokIndx);     // convert this part to a float

}

//============

void showParsedData() {
    Serial.print(ServoA);
    Serial.print(", ");
    Serial.println(ServoB);
}
void movement(){
  MotorServo.write(ServoA);
  SteerServo.write(ServoB);
}
void CamMovement(){
  CamServoC.write(ServoC);
  
}
  void CheckConnection() {
    if(receivedChars == "start"){
      Serial.print(receivedChars);
      Connection = true;
    }
    else{
      return;
    }
  }
  void recvWithEndMarker() {
  static byte ndx = 0;
  char endMarker = '\n';
  char rc;
  
  // if (Serial.available() > 0) {
           while (Serial.available() > 0) {
    rc = Serial.read();
Serial.print(rc);
    if (rc != endMarker) {
      receivedChars[ndx] = rc;
      ndx++;
      if (ndx >= numChars) {
        ndx = numChars - 1;
      }
    }
    else {
      receivedChars[ndx] = '\0'; // terminate the string
      ndx = 0;
    }
  }
}

micro/controller/xbee cordinator

#include <SoftwareSerial.h>
SoftwareSerial Fido(4, 5); // RX, TX
#include <Servo.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

#include <PS2X_lib.h>  //for v1.6
#define PS2_DAT        9  //14    
#define PS2_CMD        11  //15
#define PS2_SEL        10  //16
#define PS2_CLK        12  //17
//#define pressures   true
#define pressures   false
//#define rumble      true
#define rumble      false
const byte numChars = 32;
char receivedChars[numChars];  // an array to store the received data
boolean newData = false;
int LYVALUE;
int LXVALUE;
int oldLYvalue;
int oldLXvalue;
int RYVALUE;
int RXVALUE;
int oldRYvalue;
int oldRXvalue;
boolean Connection = false;

PS2X ps2x;
int error = 0;
byte type = 0;
byte vibrate = 0;

void setup() {

  Serial.begin(9600);
  Fido.begin(9600);

  delay(300);  //added delay to give wireless ps2 module some time to startup, before configuring it

  lcd.begin (16, 2);
  lcd.clear();
  lcd.setBacklight(HIGH);
  lcd.setCursor(0, 0);
  lcd.print("Activating Fido!");
  lcd.setCursor(0, 1);
  lcd.print("****************");
  delay(1000);
  //setup pins and settings: GamePad(clock, command, attention, data, Pressures?, Rumble?) check for error
  ps2x.config_gamepad(PS2_CLK, PS2_CMD, PS2_SEL, PS2_DAT, pressures, rumble);
  }
 

void loop() {

  if (Connection == false) {
    lcd.clear();
    lcd.setBacklight(HIGH);
    lcd.setCursor(1, 0);
    lcd.print("No Connection!");
    lcd.setCursor(3, 1);
    lcd.print("Push Start");
    ps2x.read_gamepad(false, vibrate);
    
      if (ps2x.Button(PSB_START))
      {
         lcd.clear();
        lcd.setBacklight(HIGH);
        lcd.setCursor(1, 0);
        lcd.print("...Connecting...");
        lcd.setCursor(3, 1);
        lcd.print("Please Wait");
        Serial.println("start");
        Fido.println("start");   
      }
    recvWithEndMarker();
    CheckConnection();
    return;
  }

  else { //DualShock Controller
    ps2x.read_gamepad(false, vibrate); //read controller and set large motor to spin at 'vibrate' speed
    if (ps2x.NewButtonState())
    { //will be TRUE if any button changes state (on to off, or off to on)
      if (ps2x.Button(PSB_L3))
      {
        Serial.println("L3 pressed");
        Fido.println("L3 pressed");
      }
    }
    // circle button///////////////
    if (ps2x.ButtonPressed(PSB_CIRCLE))
    {
      Serial.println("Circle just pressed");
      Fido.println("Circle just pressed");
    }
    //X button/////////////////////////////////////////
    if (ps2x.ButtonPressed(PSB_CROSS))
    {
      Serial.println("X just pressed");
      Fido.println("X just pressed");
    }
    if (ps2x.ButtonReleased(PSB_CROSS))
    {
      Serial.println("X just released");
      Fido.println("X just released");
    }
    //Square button///////////////////////////////////
    if (ps2x.ButtonReleased(PSB_SQUARE))
    {
      Serial.println("Square just released");
      Fido.println("Square just released");
    }
    if (ps2x.ButtonPressed(PSB_SQUARE))
    {
      Serial.println("Square just pressed");
      Fido.println("Square just pressed");
    }
    //Stick Values
    LYVALUE = ps2x.Analog(PSS_LY);
    LYVALUE = map(LYVALUE, 0, 255, 130, 45);
    LXVALUE = ps2x.Analog(PSS_LX);
    LXVALUE = map(LXVALUE, 0, 255, 39, 120);

    RYVALUE = ps2x.Analog(PSS_RY);
    RYVALUE = map(RYVALUE, 0, 255, 0, 180);
    RXVALUE = ps2x.Analog(PSS_RX);
    RXVALUE = map(RXVALUE, 0, 255, 0, 180);

    delay(10);
    if (LXVALUE != oldLXvalue || LYVALUE != oldLYvalue) {
      Serial.print("<");
      Serial.print("LXYValues");
      Serial.print(",");
      Serial.print(LYVALUE, DEC);
      Serial.print(",");
      Serial.print(LXVALUE, DEC);
      Serial.println(">");

      Fido.print("<");
      Fido.print("LXYValues");
      Fido.print(",");
      Fido.print(LYVALUE, DEC);
      Fido.print(",");
      Fido.print(LXVALUE, DEC);
      Fido.println(">");

      oldLXvalue = LXVALUE;
      oldLYvalue = LYVALUE;

    }
    if (RXVALUE != oldRXvalue || RYVALUE != oldRYvalue) {

      Serial.print("-");
      Serial.print("RXYValues");
      Serial.print(",");
      Serial.print(RYVALUE, DEC);
      Serial.print(",");
      Serial.print(RXVALUE, DEC);
      Serial.println(">");

      Fido.print("-");
      Fido.print("RXYValues");
      Fido.print(",");
      Fido.print(RYVALUE, DEC);
      Fido.print(",");
      Fido.print(RXVALUE, DEC);
      Fido.println(">");

      oldRXvalue = RXVALUE;
      oldRYvalue = RYVALUE;
    }
    delay(50);
  }
}
void recvWithEndMarker() {
  static byte ndx = 0;
  char endMarker = '\n';
  char rc;

  // if (Serial.available() > 0) {
  while (Fido.available() > 0 && newData == false) {
    rc = Fido.read();
    Serial.print(rc);
    if (rc != endMarker) {
      receivedChars[ndx] = rc;
      ndx++;
      if (ndx >= numChars) {
        ndx = numChars - 1;
      }
    }
    else {
      receivedChars[ndx] = '\0'; // terminate the string
      ndx = 0;
      newData = true;
    }
  }
}

void CheckConnection() {
  if (newData == true) {
    Serial.println(receivedChars);
    if (receivedChars == "start") {
      lcd.clear();
      lcd.setBacklight(HIGH);
      lcd.setCursor(1, 0);
      lcd.print("Connected!");
      lcd.setCursor(3, 1);
      lcd.print("Enjoy!");
      Connection = true;
    }
  }
  else {
    return;
  }
}