Motor run button is not Working using bluetooth connected with arduino

Greetings everyone, So we are doing an app that is
Connected to arduino by Bluetooth to run a motor using a speed slider to determine the speed value, the Bluetooth is shown to be connected but nothing happens with using slider and the run button ,and I'm not sure whether the problem is with my MIT codes or from the arduino source code

Here is a code snippet:

Upload that here.

Now it workss thanks , but we found another error , so the arduino should calculate the velocity in rpm and send it to the app , the ardunio terminal shows that it is changing , but in app it receives nothing!!
Is there something with my code :