Looking for assistance with PS2 joysticks(PS2X library) , Xbee(s) and AD5206.

(not sure how to use this forum, got desperate and not sure of the forum functions)

A bomb disposal robot was donated to our school, specifically our Tech shop. My friend and I, have been tasked with creating a custom remote, or utilizing a form of controller, to the robot. After a bit of time, we have achieved the ability to drive the robot 'Wired' with a PS2 remote, using the P2SX Library, an Arduino Uno and an AD5206 digital potentiometer.

Here's what our Arduino Code for our Wired Drive looks like:

#include <PS2X_lib.h>
#include <SPI.h>
PS2X ps2x;
const int slaveSelectPin = 10;

int LeftRead = ps2x.Analog(PSS_LY);
int RightRead = ps2x.Analog(PSS_RY);
int LeftDrive;
int RightDrive;
int error = 0; 
byte type = 0;
byte vibrate = 0;
void setup() {
  ps2x.config_gamepad(4,5,6,12, false, false);
  pinMode(slaveSelectPin, OUTPUT);
  SPI.begin();
  Serial.begin(9600);
}

void loop() {
  ps2x.read_gamepad(false, vibrate);
  LeftRead = map(ps2x.Analog(PSS_LY), 0, 255, 0, 255);
  RightRead = map(ps2x.Analog(PSS_RY), 0, 255, 0, 255);
  if(LeftRead > 120){
    if(LeftRead < 135){
    LeftDrive = 107;
  }
  }
  if(LeftRead < 100){
    LeftDrive = LeftRead;
  }
  if(LeftRead > 145){
    LeftDrive = LeftRead;
  }
  if(RightRead > 100){
    if(RightRead < 145){
    RightDrive = 127;
  }
  }
  
  if(RightRead < 100){
     RightDrive = RightRead;
  }
  if(RightRead > 145){
    RightDrive = RightRead;
  }
  Serial.print("Left:");
  Serial.println(LeftRead);

  Serial.print("Right:");;
  Serial.println(RightRead);

 
  digitalPotWrite(0, RightDrive);
  digitalPotWrite(1, LeftDrive);
  delay(50);
}

void digitalPotWrite(int address, int value) {
  digitalWrite(slaveSelectPin, LOW);
  SPI.transfer(address);
  SPI.transfer(value);
  digitalWrite(slaveSelectPin, HIGH);
}

we've used the Xbee(s) to transfer single byte letters (not in the above code)
but I'm not quite sure how to transfer Joystick values from one Arduino+Xbee, to the receiving Arduino+Xbee.

The joystick values range from 0 - 255 (0, full up on Y axis, for both sticks).

the send board, which would consist of the PS2 controller, an Arduino Uno and an Xbee(Send), the Receiving board consisting of another Arduino Uno, an Xbee(Receive) and the AD5206 chip.

how could I transfer and receive values from Left joystick and Right joystick, which are constantly changing?

also, sometimes our controller communication to the chip (Wired) cuts out. The controller keeps outputting to the serial monitor, so I know it's sending the values to the chip, but the robot won't respond. In order to get a response from the robot(get it to drive according to the joystick values sent), we need to unplug the arduino and plug it back in.

any help would be greatly appreciated.

EDIT: Figured it out. it's now wireless.