Make conditioned action only occur once.

I'm trying to make a code where a servo is actuated after a 2 conditions are met but I want the code to only do it once. I'm trying to use a while loop to do this by defining a variable first and changing its value inside the while loop but when I do that it doesn't recognise the conditions and doesn't actuate. I want to have an led turn on when the servo actuates so I was thinking I could use that as the condition for the while loop with a digitalRead but when I try that it give me the error; "lvalue required as left operand of assignment." Please help

servo_max_press.ino (2.46 KB)

What is this intended to do ?

  while (digitalRead(13 = LOW)){

And it should be ==

Using pin 13 may not be wise as it is the onboard LED and can be affected by other things.

The usual way to make something work once is to use a variable to record that it has happened - something like this

boolean actionDone = false;

if (actionDone == false) {
   doAction();
   actionDone = true;
}

...R