[how] stopping arduino to send multiple string on the terminal

hi there,

i am kind a newbie to this world and i was emulating serial communication on arduino using virtual terminal on the proteus. i just wrote a code below to send appropiate string massage to the terminal, nut when i press the input appears, arduino sends multiple massage (duplicate) on the terminal instead of just one massage per decision. i don’t know whats wrong can some one help me out

// delaration of the analogue input
float inputSignalRoom1 = 0;
float inputSignalRoom2 = 0;
float normValue1 = 0;
int button1 = A0;
int R1Green = 5;
int R1Red = 6;
boolean lastGreenStatus = LOW;
boolean lastRedStatus = LOW;
long timeR = 0;
long timeG = 0;
long timeD = 0;




// main program set up
void setup ()
{
  Serial.begin(9600);
  pinMode(R1Green, OUTPUT);
  pinMode(R1Red, OUTPUT);
}

// main program 
void loop()
{
  // get value of input of the room1
  inputSignalRoom1 = analogRead(button1);
  normValue1 = (inputSignalRoom1/204.6)*200;
  
  if (normValue1>= 241 && normValue1 < 347 && lastRedStatus == LOW)
  {
    digitalWrite(R1Green, HIGH);
    Serial.println("hellow i need assistance, room# 1");
    Serial.println("hellow i need assistance, room# 1");
    lastGreenStatus = HIGH;
    timeG = millis();
  }
  
  else if (normValue1 >= 347 && normValue1 < 460 && lastGreenStatus == HIGH)
  {
    digitalWrite(R1Red, HIGH);
    digitalWrite(R1Green, LOW);
    Serial.println("further assistance needed, room# 1");
    lastGreenStatus = LOW;
    lastRedStatus = HIGH;
  }
  
  else if (normValue1 >= 460 && normValue1 <= 580 )
  {
    digitalWrite (R1Green, LOW);
    digitalWrite (R1Red, LOW);
    lastGreenStatus = LOW;
    lastRedStatus = LOW;
    timeD = ((millis() - timeG));
    Serial.println("alarm disabled, room# 1");
    Serial.print("The alarm took :  ");
    Serial.println(timeD);
    Serial.println("  sec.");    
  }
}
Serial.println("hellow i need assistance, room# 1");
    Serial.println("hellow i need assistance, room# 1");

Duplicates, you say?

Please use code tags when posting code.

yes i want that line t be printed twice, but instead arduino print the same line more than 5 times, while i just want only two of it

Remember that the loop function keeps getting called over and over and over again. SO if the condition was met and it printed, chances are that in a few nanoseconds when the same code comes around again that condition will still be met and the Arduino prints again.

You could introduce a variable that keeps up with whether or not you've printed anything before. You could introduce some timing variables to make the printing only happen every so often. You could move the whole thing into setup where it only ever runs once. You realy haven't been clear about what the code is supposed to do so I have no way to tell which of those options is most appropriate.