HOW TO DISPLAY DELAY IN SERIAL MONITOR?

can anyone help me?
this is my code
how can i display delay in serial monitor.
serial.print(delay) // its like this but i know this is not the code

const int buttonPin = 2; // the number of the pushbutton pin
const int ledPin = 13; // the number of the LED pin

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
Serial.begin(9600);

}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
Serial.println("PLEASE WAIT WHILE REFUELING");
Serial.print('\n');
delay(9000);

digitalWrite(ledPin, LOW); // turn the LED off by making the voltage LOW
Serial.println("price 40");
Serial.print('\n');
Serial.print('\n');
Serial.println("liters 1");
}
else {
// turn LED off:

}
}

please repz.... :blush:

Welcome to the Forum. Please read the two posts by Nick gammon at the top of this Forum for guidelines on making a post, especially the use of code tags when posting code. It will help us help you.

araneil16:
how can i display delay in serial monitor.
serial.print(delay) // its like this but i know this is not the code

delay() means 'stop program execution at once, wait until time is over, then continue'.

What do you really want?
Something that looks like a 'progress bar' in the serial monitor to visualize the waiting time?

const int buttonPin = 2;     // the number of the pushbutton pin
const int ledPin =  13;      // the number of the LED pin

// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status

void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT);      
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
  Serial.begin(9600);   

}

void loop(){
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);


  // check if the pushbutton is pressed.
  // if it is, the buttonState is HIGH:
  if (buttonState == HIGH) {     
    // turn LED on:    
    digitalWrite(ledPin, HIGH); 
    Serial.println("PLEASE WAIT WHILE REFUELING");
    Serial.print('\n');
    for(int i=0;i<90;i++) Serial.print('.'); // print empty 'progress bar' of length
    Serial.println();
    for(int i=0;i<90;i++)  // then print real 'progress bar' with delay up to the length
    {
     delay(100);
     Serial.print('*');
    }
    Serial.println();
    digitalWrite(ledPin, LOW);    // turn the LED off by making the voltage LOW
    Serial.println("price 40");
    Serial.print('\n');
    Serial.print('\n');
    Serial.println("liters 1");   
  } 
  else {
    // turn LED off:

  }
}

araneil16:
serial.print(delay) // its like this but i know this is not the code

That is not the code for two reasons:
It's "Serial", not "serial". Case matters.
You left off the ';' at the end of the statement.

Why do you want to print the value of a function pointer?
You'll have to cast it to a plain numeric type, like "unsigned int"

By the way, a thread bump after nine minutes is a little . . . needy.