Morse Code Project

This is not "your" forum. You are not the center.

Referring to post #1 of this topic (which is the same subject as your other topic)... work on button debounce and arrays....

int toneFreq = 2500;

2500Hz will become annoying, soon. Use low, natural frequencies, like 440 (dit), 220 (dah).
references for more ear-pleasing tones:

int debounceDelay = 30;

Button debounce will be near 100ms if only polling one button. When the processor is busy, lower debounce values can work more than fail. Your debounce method is strange.

int wordSpace = dotLength * 3.5;

Again, referring to your other topic with the same subject, this is also incorrect (you were using 9 before)... intra-word gap is ( dit * 7 ).

int index;

... is never used.

  Serial.begin(9600);

You will find Serial.begin(115200); more responsive.

  pinMode(outputPin, OUTPUT);  // <-- Configure pin 6 as output

Still wrong comment. outputPin is pin 9.

  Serial.print("H .... ");

You have ASCII value of letters and an array of Morse equivalents. Use 'A' = 65 and letters[0] to make your Morse. See "arrays" below...

  if (millis() - lastInputTime > timeoutDuration) {
    morseInput = "";
    Serial.println("\nTimeout! Waiting for new Morse code input...");
  }

This will trigger "time out waiting," always, after "HOWDY" and again after "INITIATE." Your HOWDY has 35 element times at 2.73 wpm taking over 30 seconds, with your timeout set at only 20 seconds (timeoutDuration) and "INITIATE" is well over two minutes... so everything becomes "waiting."

Use more-descriptive variables that are "searchable"...

int t1, t2;

...for example, searching for the variable "i" is impossible.

    while (digitalRead(buttonPin) == LOW) {
      delay(debounceDelay);
    }

    delay(debounceDelay);

This looks like your "button press"... What you want to look for is changes from HIGH (released) to LOW (pressed) rather than just LOW/pressed.

  if (previousState == HIGH && thisState = LOW)
  //    button was pressed

Then, you want to use a non-blocking timer (millis()) to count the time between the first syllable of the button press, and the debounce timeout. You set it at 30ms... which will still be bouncing, so move it up toward 100ms.

Read about arrays... https://docs.arduino.cc/language-reference/en/variables/data-types/array/

This code pile...

  // Flash "INITIATE BOMB SEQUENCE" in Morse
  Serial.print("I .. "); flashSequence(".."); delay(wordSpace);
  Serial.print("N -. "); flashSequence("-."); delay(wordSpace);
  Serial.print("I .. "); flashSequence(".."); delay(wordSpace);
  Serial.print("T - "); flashSequence("-"); delay(wordSpace);
  Serial.print("I .. "); flashSequence(".."); delay(wordSpace);
  Serial.print("A .- "); flashSequence(".-"); delay(wordSpace);
  Serial.print("T - "); flashSequence("-"); delay(wordSpace);
  Serial.print("E . "); flashSequence("."); delay(wordSpace);

  Serial.print("B -... "); flashSequence("-..."); delay(wordSpace);
  Serial.print("O --- "); flashSequence("---"); delay(wordSpace);
  Serial.print("M -- "); flashSequence("--"); delay(wordSpace);
  Serial.print("B -... "); flashSequence("-..."); delay(wordSpace);

  Serial.print("S ... "); flashSequence("..."); delay(wordSpace);
  Serial.print("E . "); flashSequence("."); delay(wordSpace);
  Serial.print("Q --.- "); flashSequence("--.-"); delay(wordSpace);
  Serial.print("U ..- "); flashSequence("..-"); delay(wordSpace);
  Serial.print("E . "); flashSequence("."); delay(wordSpace);
  Serial.print("N -. "); flashSequence("-."); delay(wordSpace);
  Serial.print("C -.-. "); flashSequence("-.-."); delay(wordSpace);
  Serial.print("E . "); flashSequence("."); delay(wordSpace);

Could be this... (compile and run this code) missing wordSpace and flashSequence

char* letters[] = {
  ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", // A-I
  ".---", "-.-", ".-..", "--", "-.", "---", ".--.", "--.-", ".-.", // J-R
  "...", "-", "..-", "...-", ".--", "-..-", "-.--", "--.." // S-Z
};

char words[] = {"INITIATE BOMB SEQUENCE"};
int wordssize = sizeof(words) / sizeof(words[0]);

void setup() {
  Serial.begin(115200);

  // Serial.print(words[1] - 'A');

  for (int i = 0; i < wordssize; i++) {
    Serial.print(words[i]);
    Serial.print(" ");
    Serial.print(letters[words[i] - 'A']); // or - 65
    // flashsequence
    // delay(wordspace)
    if (words[i] == ' ')
      Serial.println();
  }
}

void loop() {}