Arduino quiz with LCD

Hi,

Im using an L2c display 4x20 and i’m tyring to make a little quiz.

I’d love to make a quiz with 5 questions. If you get the answere right a green led lights up
If you get the second question right a second green led lights up.
If you get the third question wrong a red led lights up.

After 5 questions right i’d like to get '‘congratz you solved the puzzle’'on my screen.

Questions could be; what kind of tree is this; Oak or Maple.
Then if you guess Oak and its right; Indeed Oak, on to question 2
And if you choose Maple; Too bad, it is an Oak, try again.

If search a lot of quiz scripts on google but nothing seem to fit for my project

#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd = LiquidCrystal_I2C(0x27, 16, 2);

boolean buttonLeft;
boolean buttonRight;

void setup()
{
pinMode(2, INPUT); //Rechter knop buttonright
pinMode(13, INPUT); //Linker knop buttonLeft

pinMode(3, OUTPUT);   //vraag 1 goed (question 1 right)
pinMode(4, OUTPUT);   //vraag 1 fout (question 1 wrong)

pinMode(5, OUTPUT);   //vraag 2 goed (question 2 right)
pinMode(6, OUTPUT);   //vraag 2 fout (question 2 wrong)

pinMode(7, OUTPUT);   //vraag 3 goed (question 3 right)
pinMode(8, OUTPUT);   //vraag 3 fout (question 3 wrong)

pinMode(9, OUTPUT);   //vraag 4 goed/right (question 4 right)
pinMode(10, OUTPUT);   //vraag 4 fout/wrong (question 4 wrong)

pinMode(11, OUTPUT);   //vraag 5 goed/right(question 5 right)
pinMode(12, OUTPUT);   //vraag 5 fout/wrong (question 5 wrong)

lcd.init();
lcd.backlight();
lcd.setCursor(6, 1); //Introduction welcome
lcd.print(“Welkom”);
lcd.setCursor(2, 2);
lcd.print(“beste puzzelaar!”);
delay(3000);
lcd.clear();
lcd.setCursor(4, 1);
lcd.print(“Tijd voor een”);
lcd.setCursor(4, 2);
lcd.print(“kleine quiz!”);
delay(3000);
lcd.clear();
lcd.setCursor(6, 0);
lcd.print(“Ben je er”);
lcd.setCursor(5, 1);
lcd.print(“klaar voor?”);
delay(3000);

lcd.setCursor(7, 2); 
   lcd.print("3");
 delay(500);
    
     lcd.setCursor(8, 2); 
    lcd.print(".");
 delay(500);
   
     lcd.setCursor(9, 2); 
 lcd.print(".");
 delay(500);

lcd.print("2");
 delay(500);
      lcd.setCursor(10, 2); 

    lcd.setCursor(11, 2); 
    lcd.print(".");
 delay(500);
   
     lcd.setCursor(12, 2); 
 lcd.print(".");
 delay(500);
      lcd.setCursor(13, 2); 
lcd.print("1");
 delay(1000);
  lcd.clear();

}

void loop()
{
buttonLeft = digitalRead(13); // Button A
buttonRight = digitalRead(2); //Button B

Hi,
Please read the post at the start of any forum , entitled “How to use this Forum”.
Please post your complete code,
To add code please click this link;

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

How have you got your buttons wired?
If between the input pin and 5V, you will need a 10K pull down resistor between the input pin and gnd.

Tom… :grinning: :+1: :coffee: :australia:

Thanks, made a new topic with the correct use of the forum. please close this one.