Using IR to start and Stop a Timer

So I am trying to use an IR remote to start and stop a timer. I have the signal codes for the buttons I want to use and the timer starts when I press the start button but when I try to press the stop button the IR receiver signal light turns on but no value is printed to the serial monitor unlike before the timer starts. My understanding of the code makes me think this should work but it isn't. I don't think it design problem, I am pretty sure it is a coding problem.

#include <IRremote.h>
#include <IRremoteInt.h>
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x27, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

int RECV_PIN = 11;
IRrecv irrecv(RECV_PIN);
decode_results results;

word HEXnum;
double t = 0;

void setup()
{
  lcd.begin(16, 2);
  lcd.clear();

  //lcd.print("Time: ");

  Serial.begin(9600);
  irrecv.enableIRIn(); // Start the receiver
}

void loop()
{
  //lcd.setCursor(6,0);

  if (irrecv.decode(&results))
  {
    HEXnum = results.value;
    Serial.println(HEXnum);

    if (HEXnum == 9754 || HEXnum == 9755 || HEXnum == 41565)
    {
      for (double i = 0; i <= 10.01 ; i = i + .01)
      {
        t = i;
        lcd.print((String(t)) + (String("  ")));
        delay(5);
        lcd.setCursor(0, 0);

        irrecv.resume();

        if (irrecv.decode(&results))
        {
          HEXnum = results.value;
          Serial.println(HEXnum);

          if (HEXnum == 57885 || HEXnum == 28031)
          {
            //i = 15;
            lcd.print(t);
          }
        }
      }
    }

    irrecv.resume(); // Receive the next value
    delay(5);
  }
}

That's the code.

stop button the IR receiver signal light turns on but no value is printed to the serial monitor unlike before the timer starts.

you see a print on the serial monitor for start but not stop?

i'm confused by your code. i don't understand why you have a 1001 (10.01 / 0.01) iteration loop inside the code when you detect a specific IR code (e.g. 9754). without any delays, i doubt the LCD would show anything w/o immediately overwriting it.

for doing your timing experiment, as well as other things, I would suggest you use a switch statement to process specific codes (ignoring all others). One code captures a time (i.e. millis()) and another prints the difference between the current and captured time.

I do see the reason to use a switch statement instead, much easier to use. But for this part:

gcjr:
One code captures a time (i.e. millis()) and another prints the difference between the current and captured time.

What do I have to do in order to have a time to capture? That is what I used the for loop for in the code, as a timer but where would the switch statement capture the time from?

sgcalm00:
I do see the reason to use a switch statement instead, much easier to use. But for this part:

What do I have to do in order to have a time to capture? That is what I used the for loop for in the code, as a timer but where would the switch statement capture the time from?

From millis().

void loop()
{
    static unsigned long msecLst = 0;
           unsigned long msec;

    if (irrecv.decode(&results))
    {
        HEXnum = results.value;
        Serial.println(HEXnum);

        switch (HEXnum)  {
        case 9754:
        case 9755:
        case 41576:
            msecLst = millis();
            break;

        case 57885:
        case 28031:
            msec = millis ();

            Serial.print   ("elapsed time ");
            Serial.println (msec - msecLst);
            break;

        default:
            break;
        }

        irrecv.resume();
    }
}

This was super informative. Thanks a lot. I understand it a lot better now.