wth is my problem?!?!?
the error says:
exit status 1
'prevSwitchState' was not declared in this scope
and my script is:
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 5, 4, 3, 2)
; const int switchPin = 6;
int switchState = 0;
int prewSwitchState = 0;
int reply;
void setup() {
lcd.setCursor(0, 1);
pinMode(switchPin, INPUT);
lcd.print("Ask the");
lcd.setCursor(0, 1);
lcd.print("Crystal Ball!");
}
void loop() {
switchState = digitalRead(switchPin);
if (switchState != prevSwitchState) {
if (switchState == LOW) {
reply = random(8 //ignore this empty space);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("The bal says:");
lcd.setCursor(0, 1);
switch (reply) {
case 0;
lcd.print("Yes");
break;
case 1;
lcd.print("Most likely")
break;
case 2;
lcd.print("Certainly")
break;
case 3;
lcd.print("Maybe...")
break;
case 4;
lcd.print("Unsure")
break;
case 5;
lcd.print("Ask again");
break;
case 6;
lcd.print("Doubtful");
break;
case 7;
lcd.print("Nope.");
break;
}
}
}
prevSwitchState = switchState;
}
I dont understand what is the problem pls anyone help me
Thanks
