Running Motor only once

Hello everyone, I am an new to Arduino but really excited about it.

I have a problem that I have yet to figure out, I have a button "digitalRead(22)" that when something is put on top of it will initiate the code in the for loop, making the motor move a certain amount of rotations. What I need is that once pressed the code will only execute once and ignore any more reading of digitalRead(22) == LOW so that the motor won't keep moving. I only need it to read the value once the button is pressed and then after runt he code and ignore any other instances of it being low.

int servoPin = 9;
int servoPosition = 2000; // position in microseconds
int i=0;
void setup() {
  //Serial.begin(9600);
pinMode(servoPin, OUTPUT);
pinMode(22,INPUT);



}

void loop(){
if(digitalRead(22) == LOW)       //Button has been pressed
{
  for(i=0; i<31; i++)
  {
digitalWrite(servoPin, HIGH);
delayMicroseconds(servoPosition);
digitalWrite(servoPin, LOW);
delay(175); // wait 175 milliseconds  
  }  
}
}

HI,
what you need to read is not the button current state but the transition from HIGH state to LOW state, this can be done by storing the previous reading:

  byte buttonState = digitalRead(22);
  
  if((buttonState == LOW) && oldState == HIGH)       //Button has been pressed
  {
    // execute action...
    
  }
  oldState = buttonState;