// instead of String you can use char*
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
int button = 3;
int m = false;
void setup() {
// put your setup code here, to run once:
lcd.begin(16,2);
pinMode(button, INPUT_PULLUP);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonState = digitalRead(button);
if(buttonState == LOW & m == false){
lcd.setCursor(0,0);
m = !m;
int x = random(1,6);
lcd.setCursor(7,0);
lcd.print(x);
delay(10);
}
buttonState = digitalRead(button);
if(buttonState == HIGH & m == true){
m = !m;
delay(10);
}
}