please can any one help me to make it loop order

hello guys i’m working on project that control with bluetooth mobile app so i made 1 button and said if i recieve F make the led turn on for 500 and turn off for 1000 now it did it but for one time i want to make it continue any help please

int BluetoothData;
int led1 = 9;
int led2 = 10;
int led3 = 11;
int led4 = 12;
int buzz = 8;
void setup()
{
  Serial.begin(9600);
  pinMode(led1,OUTPUT);
   pinMode(led2,OUTPUT);
    pinMode(led3,OUTPUT);
     pinMode(led4,OUTPUT);
      pinMode(buzz,OUTPUT);
}


void loop()
{
  if(Serial.available())
  {BluetoothData=Serial.read();
  
  if(BluetoothData=='F')
  {
        digitalWrite(10,HIGH);
    delay(500);
    digitalWrite(10,LOW);
    delay(1000);
  }
  else{
        digitalWrite(10,LOW);

  }
  

}}

Each time you send "F" by BT, the LED will blink. Once.

yes i need it to continue not once

Lose the {} which currently mean that led stuff is conditional on there being serial available. (edit for clarity: by which I mean, make only the serial read conditional)

(And also check that BT's not sending any line ends that would even then overwrite the F with a \n and or \r)

rahmou:
yes i need it to continue not once

Here's your code rewritten and cleaned up:

int BluetoothData;
int led1 = 9;
int led2 = 10;
int led3 = 11;
int led4 = 12;
int buzz = 8;
bool flashFlag = false;

void setup() {
  Serial.begin(9600);
  pinMode(led1, OUTPUT);
  pinMode(led2, OUTPUT);
  pinMode(led3, OUTPUT);
  pinMode(led4, OUTPUT);
  pinMode(buzz, OUTPUT);
}

void flashLED() {
  digitalWrite(10, HIGH);
  delay(500);
  digitalWrite(10, LOW);
  delay(1000);
}
else {
  digitalWrite(10, LOW);
}


void loop() {
  if (Serial.available()) {
    BluetoothData = Serial.read();

    if (BluetoothData == 'F') {
      flashFlag = true;
    }

    if (flashFlag) flashLED();

  }
}

Some tips:
Put your opening brace on the line where your code block starts. It doesn't matter to the compiler, but it's easier to read. And learn to use CTRL-T in the IDE to clean up your indentation.

Keep your loop as tight as possible. Avoid any delays or other blocking code in the loop(). You will appreciate this sometime in the distant future.

What I did was to make the flashLED into a function. In the loop- when an "F" is received from the BT, a flag gets set. If the flag is 'true', then call the flash function.

If you want to turn off the flash, just add a new test of the BT data for the off character and set the flag to 'false'.