Bluetooth (HC-05) car controlled via joystick

Here is example code to read a joystick (2 axes) and send the values via Bluetooth HC05. Then receive and parse the data with another HC05. I use methods from the serial input basics tutorial. You will have to change pin numbers and baud rates to match your setup. I see that you set up a software serial port but do not use it. Why? Trying to use the hardware serial for both the HC05 and serial monitor often does not work.
The default communication baud rate (as opposed to the AT mode baud rate) is usually 9600 so that is what I use for SoftwareSerial. I use 115200 for hardware serial (serial monitor).

Sender (master)

#include <SoftwareSerial.h>

const byte xPin = A0;
const byte yPin = A1;

SoftwareSerial ss(4, 7);

void setup()
{
   Serial.begin(115200);
   ss.begin(9600);
}

void loop()
{
   static unsigned long timer = 0;
   unsigned long interval = 1000;
   if (millis() - timer >= interval)
   {
      timer = millis();
      int xValue = analogRead(xPin);
      int yValue = analogRead(yPin);
      Serial.print("x value = ");
      Serial.print(xValue);
      Serial.print("   y value = ");
      Serial.println(yValue);
      char buffer[15];
      snprintf(buffer, 14, "%d,%d", xValue, yValue);
      Serial.println(buffer);
      ss.println(buffer);
   }
}

Receiver (slave)

#include <SoftwareSerial.h>

int xValue = 0;
int yValue = 0;

const byte numChars = 32;
char receivedChars[numChars];   // an array to store the received data

boolean newData = false;

SoftwareSerial ss(4, 7);

void setup()
{
   Serial.begin(115200);
   ss.begin(9600);
}

void loop()
{
 recvWithEndMarker();
   //showNewData();
   if (newData)
   {
      parseData();
      displayData();
      newData = false;
   }
}

void recvWithEndMarker()
{
   static byte ndx = 0;
   char endMarker = '\n';
   char rc;

   while (ss.available() > 0 && newData == false)
   {
      rc = ss.read();

      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 showNewData()
{
   if (newData == true)
   {
      Serial.print("This just in ... ");
      Serial.println(receivedChars);
      //newData = false;
   }
}

void parseData()
{
   char *strings[2]; // an array of pointers to the pieces of the above array after strtok()
   char *ptr = NULL; byte index = 0;
   ptr = strtok(receivedChars, ",");  // delimiter comma
   while (ptr != NULL)
   {
      strings[index] = ptr;
      index++;
      ptr = strtok(NULL, ",");
   }
  
   // convert string data to numbers
   xValue = atoi(strings[0]);
   yValue = atoi(strings[1]);   
}

void displayData()
{
   Serial.print("x value = ");
   Serial.print(xValue);
   Serial.print("   y value = ");
   Serial.print(yValue);
   
   Serial.println(); // blank line  
}