Slowly increase speed using PWM arduino
However, the loop keep repeating.


That's the whole point of loop(). If you want some code to run only once after the program starts put it in setup():

int motor = 9;
int fadeValue = 5;

void setup() {
  pinMode(motor, OUTPUT);

  for (int fadeValue = 5 ; fadeValue &lt;= 245; fadeValue += 10) {
    analogWrite(motor, fadeValue);
    delay(100);
    if (fadeValue == 245)
    {
      fadeValue = 255;
      break;
    }
  }
}

void loop() {
}