How to use if statements

Hello everyone,

I am a complete noob when it comes to Arduino programming, Basically I want , that if the user does not type anything in serial monitor for at least 3 seconds then the serial monitor prints "??" or something else.

I hope you all can help!

You should start with the examples which are aimed to n00bs. I am sure you can find answer there.
For any further advice it is better post your code.

How's this?

// 2 august 2019
// remind user for serial input

int interval = 3000;
unsigned long startTheClock;
char receivedChar;

void setup()
  Serial.println(".... remind user for serial input ....");
  Serial.print("Compiler: ");
  Serial.print(", Arduino IDE: ");
  Serial.print("Created: ");
  Serial.print(", ");

  //turn off L13
  digitalWrite(LED_BUILTIN, LOW);

  Serial.println("Type something....");

} //setup

void loop()

  if (Serial.available() > 0)
    receivedChar =;
    Serial.print("You typed ");
    startTheClock = millis();

  if (millis() - startTheClock >= interval)
    Serial.println("Are you there?");
    startTheClock = millis();
} //loop