:o Hi guys, I was wondering if there is a command that would allow screen to go back onto:
"Ask the super Johnnycash" a few second after question has been answered?
Thanks for your help!
Here is the code:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
const int switchPin = 6;
int switchState = 0;
int prevSwitchState = 0;
int reply;
void setup() {
lcd.begin(16, 2);
pinMode(switchPin, INPUT);
lcd.print("Ask the super"); //10
lcd.setCursor(0, 1);
lcd.print("Johnnycash");
}
void loop() {
switchState = digitalRead(switchPin);
if (switchState != prevSwitchState){
if (switchState ==LOW) {
reply = random(8 );
lcd.clear();
lcd.setCursor(0, 0); //20
lcd.print("Super Johnny says:");
lcd.setCursor(0, 1);
switch(reply){
case 0:
lcd.print("No =(");
break;
case 1:
lcd.print("Most likely");
break;
case 2: //30
lcd.print("Certainly");
break;
case 3:
lcd.print("outlook Good");
break;
case 4:
lcd.print("Unsure");
break;
case 5:
lcd.print("Ask again"); //40
break;
case 6:
lcd.print("Doubtfull");
break;
case 7:
lcd.print("Yes =)");
break;
}
}
} //50
prevSwitchState = switchState;
}
Thanks!