Servo Operation

I wanted to run the servo using HC05 Bluetooth slowly like if I press a button then till I press the button then the servo will increase/decrease its angle.
please help me writing that code.

(deleted)

I have tried but it's not working that's why I have asked

Are we suppose to guess what is in your code? Look at the stickies at the top of this section. Take some time. Read them in detail. Post your code as they advise, in code tags.

(deleted)

Sorry for that :sob: the code that I have used is
The Bluetooth application will pass 5 or 6 as value when I touch down the button and as soon as I lift off my hand it will pass 1 via Bluetooth.

 #include <AFMotor.h>
  #include <Servo.h> 
  #include <SoftwareSerial.h>

  SoftwareSerial bluetooth(A4,A5);

  Servo servo1;

  int servo1PPos;

  void setup() 
    {
      Serial.begin(9600);
      bluetooth.begin(9600);
      pinMode(A5,OUTPUT);
      pinMode(A4,INPUT);
      servo1.attach(9);
      servo1PPos = 0;
    }

  void loop() 
    {
      if( bluetooth.available()>0 )
        {
          int value = bluetooth.read();
          Serial.println(value);
          if( value == 5 )
            {
              while(value == 5 )
                {
                  servo1.write(servo1PPos);
                  servo1PPos++;
                  delay(100);
                  if(servo1PPos == 160)
                  break;
                }
            }

          if( value == 6 )
            {
              while(value == 6 )
                {
                  servo1.write(servo1PPos);
                  servo1PPos--;
                  delay(100);
                  if(servo1PPos == 0)
                  break;
                }

          if( value == 1 )
            {
              servo1.write(servo1PPos);      
            }
            }
        }
    }

My understanding of this forum is to help users to learn.

Your Arduino has a lot of IO-pins.
You have to specifiy and control exactly that IO-in your servo is connected to

So analyse which lines of your code are related to the output-signal that must your arduino create and variate?

best regards Stefan

O.k. we have the code. But "it's not working" isn't a very useful problem statement. Please tell us exactly what that code is doing and why that is wrong.

Steve