Using IR remote to change car mode

Separate command input by IR or manual from command execution. Whenever a command entry is detected store it in LastCommand and execute the command in loop().