i'm try to make a quiz for my project however im encountering a problem when the user have to chose the answer as the previous output is being outputted. the above is my code
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
// print the number of seconds since reset:
buttonState = digitalRead(buttonPin);
lcd.setCursor(1, 7);
for(i=0;i<1;i++){
if (buttonState == HIGH) {
// turn LED on:
lcd.print("SPORTS WAS CHOSEN");
delay(1000);
lcd.clear();
lcd.setCursor(0, 0);
buttonState == LOW;
}
}
lcd.print("Which team won ");
lcd.setCursor(0, 1);
lcd.print("the World cup?");
lcd.setCursor(0, 2);
lcd.print(" a. A");
lcd.setCursor(0, 3);
lcd.print(" B. B");
buttonState = digitalRead(buttonPin);
if(buttonState == HIGH){
lcd.print(" Wrong answer ");
digitalWrite(led, HIGH);
delay(1000);
}
}