An interest things on my lcd

i want make a length counter but i have got a problem when i press button my lcd write interest things.

#include<LiquidCrystal.h>;
const int trig = 13;
const int echo = 10;
int mesafe = 0;//in english it means distance
int mesafe1 = 0;//in english it means distance1
int distance = 0;
int timer = 0;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int button1 = 7;
const int button2 = 6;
int distance1 = 0;
void setup() {
  // put your setup code here, to run once:
  lcd.begin(16,2);
  pinMode(echo, INPUT);
  pinMode(trig, OUTPUT);
  pinMode(button1, INPUT);
  pinMode(button2, INPUT);
  Serial.begin(9600);


}

void loop() {
  // put your main code here, to run repeatedly:
  int button1state = digitalRead(button1);

  if(button1state == HIGH){
    digitalWrite(trig, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trig, LOW);
  timer = pulseIn(echo, HIGH);
  mesafe = timer/2 /28,8;
  distance = mesafe;
    lcd.write("Calibrated=");
    lcd.write(distance);
    Serial.write(distance);
    delay(3000);
    lcd.clear();
  }
 
    int button2state = digitalRead(button2);
    Serial.println(button2state);
 if(button2state == HIGH){
 digitalWrite(trig, HIGH);
  delayMicroseconds(1000);
  digitalWrite(trig, LOW);
  timer = pulseIn(echo, HIGH);
  mesafe1 = timer/2 /28,8;
  distance1 = mesafe1;
  int distance2 = distance - distance1;
  lcd.write("Length is");
  lcd.write(distance2);
  delay(3000);
  lcd.clear();

}

}

Sounds interesting. I should try it out. Thanks for the post.

can you help me in writing the code for hour glass project with LCD display.

harshranjan24: can you help me in writing the code for hour glass project with LCD display.

1) don't hijack. 2) read this carefully, then create your own thread for advice.

wvmarle: Sounds interesting. I should try it out. Thanks for the post.

please say me your project is working

My projects usually work, after sufficient tinkering.

wvmarle: My projects usually work, after sufficient tinkering.

please send me the result when you check my code on your arduino. I am from Turkey so my English is not well.

I saw some things in your code that suggest you failed to reveal A LOT of information on this project. It's of course impossible for me to try out your project based on the information given! What were you thinking? No schematics, purpose, description of what it should do and what it does.

I was actually hoping you would find out yourself that you failed to even ask a question, or even adding the typical "it doesn't work" comment or any other comment on the reason of posting here.

You also quite certainly failed to read the sticky.

So if you want real help - read that sticky, and feel free to post all the missing info.