Problem coding for robotic arm gripper

Hello everyone. I'm newbie here.

I planned to make a robotic arm controlled by a webserver. Almost all the codes are working perfectly except for the gripper. I made a code for the gripper and I don't think it match to what I really wanted. I wanted to control the gripper's servo through html button and make it move slowly by pressing the button once and make it stop by pressing it again and the same concept with the reverse of it. I need also to set its limit for the servo inorder to prevent it by destroying itself if ever forgotten to make it stop. By the way, I used a 180 servo.

If someone could help me. Any suggestion will be helpful. Thank you

By the way here is the code I made based on the code for its main arm. I'll be able to state it's lower and upper limit but I couldn't make it move slowly by pressing the button once and make it stop by pressing it again and vice versa...

           if (readString.indexOf("?buttonhold") >0){  //tell the arm to go down              
                {                                  
                  (pos=pos+30); //change value for larger increments
                  if(pos>90) (pos=90); //limit lower value                
                  servogriptwist.write(pos); // tell servo to go to position in variable 'pos'                   
                } 
           }
           if (readString.indexOf("?buttonrelease") >0){  //tell the arm to go up                
                {                  
                  (pos=pos-30); //change value for larger increments
                  if(pos<0) (pos=0); //limit upper value                  
                  servogriptwist.write(pos); // tell servo to go to position in variable 'pos'                                     
                } 
           }

like this you make just a positioning step of +/- 30 for each button click.

i would try something like this:

if (readString.indexOf("?gripperopen") >=0){  //tell the gripper to open
     gripspeed = 1;
}
if (readString.indexOf("?gripperclose") >=0){  //tell the gripper to close                
     gripspeed = -1;                                   
}           
if (readString.indexOf("?gripperhold") >=0){  //tell the gripper to stop               
     gripspeed = 0;                                  
}

And within loop, or within a function called periodically

pos += gripspeed * 2; //or some other factor...needs some testing

if(pos>90) pos=90; //limit lower value
if(pos<0) pos=0; //limit upper value                  
servogriptwist.write(pos); // tell servo to go to position in variable 'pos'

You have two other duplicate (or is that triplicate) Threads on this subject, here and here

What about the advice I gave here

You just seem to be wasting everyone's time.

...R