Bluetooth HC-06 not working

Hi! So I am trying to get my Processing program to communicate to my Arduino via HC-06 Bluetooth, and for some reason, it does not work. The Processing program keeps freezing. The entire program works if I were just to use the regular Serial port, but I want this robotics project to be Bluetooth. I have a voltage divider on my HC06 (RX port), and it is connected to the right ports as well as blinking. Does anyone know why this is happening? Any help would be appreciated. The input COM port is COM5 and the output is COM9

#include <Wire.h>
#include <Servo.h>
#include <Adafruit_MotorShield.h>
#include <SoftwareSerial.h>

SoftwareSerial hc06(2,3);

//set up motorhsield
Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x60);

//assign motors
Adafruit_DCMotor *RailMotor = AFMS.getMotor(1);
Adafruit_DCMotor *Swivel = AFMS.getMotor(2);
Adafruit_DCMotor *Screw = AFMS.getMotor(3);

//call the servo library
Servo DrillArm, ClawArm, Claw, Elbow;

const byte number_of_chars = 32;
char receivedChars[number_of_chars];
boolean new_data = false;

void setup() {

  
  // put your setup code here, to run once:
  Serial.begin(9600);
  hc06.begin(38400);
  // create with the default frequency 1.6KHz
  AFMS.begin();
  
  Elbow.attach(12);
  DrillArm.attach(11);
  ClawArm.attach(10);
  Claw.attach(9);
  Claw.write(75);
}


void loop() {
  receivePacket();
  if (new_data == true) {
    parseData();
    executeParsedData();
    new_data = false;
    Serial.println(receivedChars);
    char buf[4] = {receivedChars[1], receivedChars[2], receivedChars[3], receivedChars[4]};
    int mapp = atoi(buf);
    Serial.println(mapp);

    if (receivedChars[0] == 'A'){ //claw arm control
      Serial.println(receivedChars);
      ClawArm.write(mapp);
    }

    else if(receivedChars[0] == 'B'){ //elbow control
      Serial.println(receivedChars);
      Elbow.write(mapp);
    }
    
    else if(receivedChars[0] == 'C'){ //claw open or close
      Serial.println(receivedChars);
      Claw.write(mapp);
    }

    else if(receivedChars[0] == 'D'){ //drill arm control
      Serial.println(receivedChars);
      DrillArm.write(map(mapp, 0, 180, 0, 180));
    }

    else if(receivedChars[0] == 'E'){ //rail control
      Serial.println(receivedChars);
      if (mapp > 20){
        RailMotor->setSpeed(mapp);
        RailMotor->run(FORWARD);
      }
      else if (mapp < -20){
        RailMotor->setSpeed(abs(mapp));
        RailMotor->run(BACKWARD);
      }
      else {
        RailMotor->run(RELEASE);
      }
    }

    else if(receivedChars[0] == 'F'){ //swivel control
      Serial.println(receivedChars);
      if (mapp > 15){
        Swivel->setSpeed(mapp);
        Swivel->run(FORWARD);
      }
      else if (mapp < -15){
        Swivel->setSpeed(abs(mapp));
        Swivel->run(BACKWARD);
      }
      else {
        Swivel->run(RELEASE);
      }
    }
    
    else if(receivedChars[0] == 'G'){ //screw control
      Serial.println(receivedChars);
      if (mapp > 15){
        Screw->setSpeed(mapp);
        Screw->run(FORWARD);
      }
      else if (mapp < -15){
        Screw->setSpeed(abs(mapp));
        Screw->run(BACKWARD);
      }
      else {
        Screw->run(RELEASE);
      }
    }
   
  }
}

Arduino 2nd Tab:

#include <SoftwareSerial.h>
#include <Wire.h>

int red_led = 3;
int green_led = 6;
int blue_led = 5;
int int_1 = 0;
int int_2 = 0;
int int_3 = 0;

void receivePacket() {
  static boolean receiving = false;
  static byte index = 0;
  char start_mark = '<';
  char end_mark = '>';
  char rc;
  while (hc06.available() > 0 && new_data == false) {
    rc = hc06.read();
    if (receiving == true) {
      if (rc != end_mark) {
        receivedChars[index] = rc;
        index++;
        if (index >= number_of_chars) {
          index = number_of_chars-1;
        }
      } else {
        receivedChars[index] = '\0';
        receiving = false;
        index = 0;
        new_data = true;
      }
    } else if (rc == start_mark) {
      receiving = true;
    }
  }
}

void parseData() {
  char * split;
  split = strtok(receivedChars, ",");
  int_1 = atoi(split);
  split = strtok(NULL, ",");
  int_2 = atoi(split);
  split = strtok(NULL, ",");
  int_3 = atoi(split);
}

void executeParsedData() {
  if (int_3 == 0) {
    analogWrite(red_led, 0);
    analogWrite(green_led, 0);
    analogWrite(blue_led, 0);
  } else if (int_3 == 1) {
    analogWrite(red_led, 255);
    analogWrite(green_led, 255);
    analogWrite(blue_led, 255);
  } else if (int_3 == 2) {
    if (int_2 == 0) analogWrite(red_led, int_1);
    if (int_2 == 1) analogWrite(green_led, int_1);
    if (int_2 == 2) analogWrite(blue_led, int_1);
  }
}

Processing:

import processing.serial.*;
import net.java.games.input.*;
import org.gamecontrolplus.*;
import org.gamecontrolplus.gui.*;

Serial port;
ControlDevice cont;
ControlIO control;
float swivel, screw, rail, selectcontrol;
boolean shoulderselect, elbowselect, clawarmselect, clawgrab, clawrelease;
String portmessage, string;
PImage splash;

void setup(){
  size(700, 400);
  control = ControlIO.getInstance(this);
  cont = control.getMatchedDevice("STAR_2021_Artificial_Astronauts_controls");
  
  if (cont == null) {
    println("No suitable device configured, exiting program"); 
    System.exit(-1);
  }
  
  splash = loadImage("Artificial Astronaut Control Scheme");
  println((Object[])Serial.list());
  port = new Serial(this, "COM9", 38400);
}

public void getUserInput() {
  screw = map(cont.getSlider("Screw").getValue(), -1, 1, 0, 180);
  swivel = map(cont.getSlider("SwivelJoint").getValue(), -1, 1, 0, 180);
  rail = map(cont.getSlider("Rail").getValue(), -1, 1, 0, 180);
  selectcontrol = map(cont.getSlider("SelectControl").getValue(), -1, 1, 0, 360);
  shoulderselect = cont.getButton("ShoulderSelect").pressed();
  elbowselect = cont.getButton("ElbowSelect").pressed();
  clawarmselect = cont.getButton("ClawArmSelect").pressed();
  clawgrab = cont.getButton("ClawGrab").pressed();
  clawrelease = cont.getButton("ClawRelease").pressed();
}


            
void draw() {
  getUserInput();
  background(selectcontrol,400,400);
  //send a list that consists of the joint's name and, position(and direction) to the serial for the arduino
  if(clawarmselect){ //control claw arm with right stick
    println("Selecting the claw arm to control, use the right stick to control");
    portmessage = "<A"+str((int)selectcontrol/2)+">";
    port.write(portmessage);
    clawarmselect = false;
  }
  
  if(elbowselect){ //control elbow with button and control right stick
    println("Selecting the elbow to control, use the right stick to control: ");
    portmessage = "<B"+str(((int)selectcontrol/2))+">";
    port.write(portmessage);
    print(portmessage);
    elbowselect = false;
  }
  
  if(clawgrab){ //close claw
    println("Claw Closing");
    port.write("<C75>");
    clawgrab = false;
  }
  
  if(clawrelease){ //open claw
    println("Claw Opening");
    port.write("<C0>");
    clawrelease = false;
  }
  
  if(shoulderselect){ //control elbow with button and control right stick
    println("Selecting the shoulder to control, use the right stick to control: ");
    portmessage = "<D"+str((int)selectcontrol)+">";
    port.write(portmessage);
    shoulderselect = false;
  }
  
  if(rail > 105 | rail < 80){ //control elbow with button and control right stick
    println("Selecting the rail to control, use the left stick to control: ");
    portmessage = "<E"+str((int)rail)+">";
    print(portmessage);
    port.write(portmessage);
  }
  
  if(swivel > 105 | swivel < 80){ //control swivel with button and control right stick
    println("Selecting the swivel to control, use the left stick to control: ");
    portmessage = "<F"+str(((int)swivel))+">";
    print(portmessage);
    port.write(portmessage);
  }
  
  if(screw > 105 | screw < 75){ //control screw with trigger buttons, right trigger goes to -1, left goes to 1
    println("Screw: ");
    portmessage = "<G"+str((int)screw-90)+">";
    port.write(portmessage);
    print(portmessage);
  }
}

void serialEvent(Serial port) {
  string = port.readStringUntil('\n');}

Is the HC06 really set to communicate at 38400 baud?

Ok so if you mean configuring the Bluetooth module, I changed my code back to 9600 baud. For some reason, my Bluetooth module does not respond when I try to change its baud rate but responds when I send something else. Any idea why this is happening?