Printing int variable to lcd

With the following code i’d like to print a variable on the lcd screen (a counter of push button), but i don’t understand why the printing chars on the lcd are random numbers.

#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

int buttonStart=10;
boolean buttonStartStatus;
int buttonStartCounter;

void setup() {

pinMode(buttonStart, INPUT);


void loop() {


if (buttonStartStatus){
lcd.setCursor(0, 0);


I guess they are not random; they are probably incrementing.

How is your button wired? Between Vcc and pin or between pin and GND? For the former, do you have a pull-down resistor from pin to GND? For the latter, do you have a pull-up resistor between Vcc and pin?

If not, your input is floating and will read randomly lows and highs when not pressed.

Yes, the numbers on the LCD display are incremental, it is not accidental. It begins with a random number as 84 and increase of about 30 every time I press the button.
He wired directly to Vcc button. The other of the button pin is wired for Arduino with a pull-down to GND pin. Attached there is a button connection diagram.

Thanks for the image.

OPs image

You need to detect the state change (LOW to HIGH), not the state. If you press the button for 500ms, your loop will count during those 500ms.

Have a look at the 'state change detection' example that comes with the IDE.

Oh, you're right!! thank you very much!