#include <LiquidCrystal.h>
LiquidCrystal lcd(13,12,11,10,9,8,7,6,5,4);
int facevalue,seed=1;
void setup() {
// put your setup code here, to run once:
pinMode(2, INPUT_PULLUP);
lcd.begin(16,2);
lcd.setCursor(0,0);
lcd.print("ElectronicDice.");
}
void loop() {
// put your main code here, to run repeatedly:
if(digitalRead(2)==0)
{
randomSeed(seed++);
facevalue=(random()%6)+1;
lcd.setCursor(0,1);
lcd.print(facevalue);
lcd.clear();
}
}