How to change and display variable in Arduino using app in MIT App Inventor 2?

Hello,

I am trying to make an Android app in MIT App Inventor 2, so that it will change and then display the new value of the variable in the app. My setup is quite simple: I have a DC motor connected to a motor driver which is connected to an Arduino UNO. I also have an HC-05 Bluetooth module connected to the Arduino.

The app is not working and i can't figure out the right approach...

bt1.3.png

int val, changepwm = 100;

void setup() {

    // initialize serial communication
    Serial.begin(9600);

}

void loop() {


  if(Serial.available())
  {
    val = Serial.read();  

    switch(val)  
    {
    
      case '1': changepwm=changepwm+5;
                   Serial.print(changepwm);
                   break;
      case 'O': changepwm=changepwm-5;
                   Serial.print(changepwm);
                   break;
    }
  }
  
}

bt1.3.png