How to stop servo from pulsating?

I wrote a code to control by blinds tilt. It works: it makes correct amount of turns and then stops. The only problem that once it stops it continues to pulsate until you physically disconnect the circuit.
I am trying to add a function to detach servo, but nothing works so far

Here is the code:

//Create servo object to control a servo
Servo myServo;
int posCurrent;

void setup() 
{
    //Attaches the servo on pin D0 to the servo object 
    myServo.attach(D0);
    posCurrent = 0;
   
    //Register our Particle to control the servo
    Particle.function("openBlinds", openBlinds);
    Particle.function("closeBlinds", closeBlinds);
}

void loop()
{ 
}

int openBlinds(String command)
{
     int newPos = command.toInt();
   // Make sure it is in the right range
   // And set the position
   posCurrent = constrain( newPos, 0 , 90);

   // Set the servo
   myServo.write( posCurrent );

   // done
   return 1;
}

int closeBlinds(String command)
{
     int newPos = command.toInt();
   // Make sure it is in the right range
   // And set the position
   posCurrent = constrain( newPos, 90 , 0);

   // Set the servo
   myServo.write( posCurrent );

   // done
   return 1;
}

One way is to do a myServo.detach()

Could you help me to modify my code with myServo.detach() added?
Thanks a lot!

Would you mind to help me modify my code with detaCH ADDED?

hERE IS MY CODE:

//Create servo object to control a servo
Servo myServo;
int posCurrent;

void setup() 
{
    //Attaches the servo on pin D0 to the servo object 
    myServo.attach(D0);
    posCurrent = 0;
    
    //Register our Particle to control the servo
    Particle.function("openBlinds", openBlinds);
    Particle.function("closeBlinds", closeBlinds);
}

void loop()
{ 
}

int openBlinds(String command)
{
     int newPos = command.toInt();
   // Make sure it is in the right range
   // And set the position
   posCurrent = constrain( newPos, 0 , 90);

   // Set the servo
   myServo.write( posCurrent );

   // done
   return 1;
}

int closeBlinds(String command)
{
     int newPos = command.toInt();
   // Make sure it is in the right range
   // And set the position
   posCurrent = constrain( newPos, 90 , 0);

   // Set the servo
   myServo.write( posCurrent );

   // done
   return 1;
}

I moved your post over here since double posting is not appreciated.

BTW, the code in the other thread does pretty much tell it all.
It’s even in the quote you have in your own post.