IR receiver/emitter

Hey guys, I’m doing a project for my Embedded Systems course. Basically I’m doing a UFC trivia using an MP3 player, LCD screen, and an IR receiver and emitter. Right now I’m just dealing with the LCD display and IR. I’m displaying 4 multiple choice options onto the screen, and then taking in input from the IR remote, i want the display to show “good job” or “Incorrect”. My current code will only flash “good job” or “incorrect” very briefly and the original multiple choices remain displayed. How do I have my code ignore the stuff behind it? Like try and get it seem more step-by-step.

#include <LiquidCrystal_I2C.h>
#include <Wire.h>
#include <IRremote.h>
#include <IRremoteInt.h>
//int 16724175 = FF30CF;
//int 16718055 = FF18E7;
//int 16743045 = FF7A85;
//int 16716015 = FF10EF;
long choice = 0;
int RECV_PIN = 22;
IRrecv irrecv(RECV_PIN);
decode_results results;
LiquidCrystal_I2C lcd(0x38, 20, 4);
void setup()
  irrecv.enableIRIn(); // Start the receiver
  Serial.println("IR Receiver Module");
  lcd.begin(20, 4);
  lcd.init(); //initialize the lcd
  lcd.backlight(); //open the backlight
void loop()
  lcd.setCursor(0, 0);
  lcd.print("1. Conor McGregor");
  lcd.setCursor(0, 1);
  lcd.print("2. Demetrius Johnson");
  lcd.setCursor(0, 2);
  lcd.print("3. Jon Jones");
  lcd.setCursor(0, 3);
  lcd.print("4. Nate Diaz");
  if (irrecv.decode(&results)) {
    choice = (results.value);
    Serial.print(choice, DEC);
    if (choice == 16718055) {
      Serial.println("  Good Job!");
      lcd.setCursor (8, 1);
      lcd.setCursor(8, 2);
    else {
      Serial.println("  Incorrect");
      lcd.setCursor(4, 1);
    irrecv.resume(); // Receive the next value

The loop() function loops, as its name implies, up to tens or hundreds of thousands of times per second. So, 100 ms after "Good job!" is displayed, your intro overwrites it.

Put the intro in setup().

okay thanks, do you have a suggestion if i want to put in more than one question, lets say 10, how i would put them all in the setup?

The questions go in loop(), with an appropriate counter (make it static or global). This would be a good case for a state machine, the "state" being the question number.

Do you have any examples of state machines? I’ve never heard of them before (big noobie)

Google "arduino state machine" for examples.