// instead of String you can use char*
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,10,9,8,7);
int button = 3;
int m = false;
int x;
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,6);
m = !m;
x=random((0,6));
delay(1);
}
buttonState = digitalRead(button);
if(buttonState == HIGH & m == true){
m = !m;
lcd.clear();
delay(1);
}
lcd.setCursor(7,0);
lcd.print(x);
}