guys i need some helps

u gave tgus code

#include <LiquidCrystal.h>
int time=20;
int s1=2;
int s2=0;
int sa=s2+s1;
int button1=53;
int button2=52;
int button3=51;
int button4=50;

LiquidCrystal lcd(27, 26, 25, 24, 23, 22);

void setup()
{
  lcd.begin(16,2);
  lcd.clear();
  pinMode(button1,INPUT);
  pinMode(button2,INPUT);
  pinMode(button3,INPUT);
  pinMode(button4,INPUT);
}
void loop()
{

  if(digitalRead(button4)==HIGH){s1=s1+1;} ;
  delay(1);
  lcd.clear();
  lcd.print(s1);
 
   
}

when i click on button4 nothing happen in lcd so what is the fulet :frowning:

Try connecting the button.

Mark

Have you been able to write text to the LCD ?
Are you sure that you are not clearing the LCD before you get a chance to see the value of s1 ? One millisecond is, after all, not very long is it ? What happens if you increase the delay() ? What do you see in the Serial monitor if you print s1 ? Put a Serial.print() statement inside the if test so that you know that it is seeing the button press. How is the button wired ?

I've added some comments to your loop function. Maybe they'll help you debug what you have

void loop()

  if(digitalRead(button4)==HIGH){s1=s1+1;} ;
  //wait 1 millisecond 
  delay(1);  
  //clear the LCD
  lcd.clear(); 
  //send s1 to the lcd BUT
  //You probably won't get a chance to see this
  //before the screen is cleared again in about 1 milliseconds time
  lcd.print(s1); 
}

guys i want if i click on the button the number will be increase the number

That's almost what you have. In fact, the number will increase as long as the switch is closed, so you need to detect when the switch becomes closed instead.

GERhashim: guys i want if i click on the button the number will be increase the number

How long do you expect your finger to be on the button? Divide that by the time it takes to execute the loop function and that's how many you'll be incrementing by on each press.

i keep my finger 1s something like this but the problem the lcd show me just 2 if i click on it will be like change and it will back again to 2 .that just a frame then it will be 2

GERhashim: i keep my finger 1s something like this but the problem the lcd show me just 2 if i click on it will be like change and it will back again to 2 .that just a frame then it will be 2

So you haven't connected your button4 correctly.

ok guys i just try it on "Proteus 8 Professional" before i buy the arduino so i will buy it then try again thank for all ppl helped me and Interaction with me :-[