getting a skid steer tank working

so we have this robot at work for cleaning ducting, and the chinese thing has the worst control ever!!

i picked up an Leonardo to replace the main control board

ive drummed up a some code to test

const int LMR = 2;
const int LMS = 3;
const int RMR = 4;
const int RMS = 5;
const int Xdeadzone = 25, Ydeadzone = 25;

void setup() {
  pinMode(LMR, OUTPUT);
  pinMode(LMS, OUTPUT);
  pinMode(RMR, OUTPUT);
  pinMode(RMS, OUTPUT);
  Serial.begin(9600);

}

void loop() 
{
  int X = analogRead(A0);
  int Y = analogRead(A3);
  int Xspeedf = map(X, 500, 650, 0, 255);
  int Yspeedf = map(Y, 500, 650, 0, 255);

  if (X >= (500 + Xdeadzone))//Forward
  { 
    if(Y > (500 + Ydeadzone)) //Left
    {
      analogWrite(LMS, Xspeedf - Yspeedf); analogWrite(RMS, Xspeedf);
      //digitalWrite(LMR, LOW); digitalWrite(RMR, LOW);
    }
    else if (Y < (500 - Ydeadzone)) //Right
    {
      analogWrite(LMS, Xspeedf); analogWrite(RMS, Xspeedf - Yspeedf);
      //digitalWrite(LMR, LOW); digitalWrite(RMR, LOW);
    }
    else
    {
      analogWrite(LMS, Xspeedf); analogWrite(RMS, Xspeedf);
      //digitalWrite(LMR, LOW); digitalWrite(RMR, LOW);
    }
   }
   else
    { // Full stop
      analogWrite(LMS,0);
      analogWrite(RMS,0);
      digitalWrite(LMR,LOW);
      digitalWrite(RMR,LOW);
    }

  Serial.println(X);
  Serial.println(Xspeedf);
  Serial.println(LMS);
  Serial.println(RMS);
  delay(100);
}

so far on the monitor can read the joystick and the associated PWM (xspeedf), but the motor outputs (LMS RMS) just stay as the pins they’re supposed to be assigned to

where am i going wrong here

      analogWrite(LMS, Xspeedf); analogWrite(RMS, Xspeedf - Yspeedf);

I see two statements on the one line. Lines are cheap. Use more of them.

What do you mean "just stay as the pins they're supposed to be assigned to"?

const int LMR = 2;
const int LMS = 3;
const int RMR = 4;
const int RMS = 5;

Of these pins only 3 & 5 are analogue.

MorganS:
I see two statements on the one line. Lines are cheap. Use more of them.

What do you mean "just stay as the pins they're supposed to be assigned to"?

when viewing the serial monitor, the values for the joystick input and the PWM adjustment change, but the output pins just say 3 & 5

Yes, you're printing the pin numbers, not what was written to the pin with analogWrite().

You need at least 2 more variables to record the output of your calculation (Xspeedf - Yspeedf) so that this can be used in the analogWrite() and in the Serial.print().

Serial.println(LMS);
  Serial.println(RMS);
const int LMS = 3;
const int RMS = 5;

Yes, it should print 3 and 5. That's what you told it to print. LMS you set to 3. You even made it const so you know it never changes. Same with RMS except you told the compiler that it would have the value 5.