Building a reaction timer

Hi, I built a reaction timer awhile ago. Lately I have been changing it and modifying it, just to experiment with. Right now when power is applied, the lcd lights up and says “Press Button to Start…” When you press the start button, it reads “-----Ready------,” randomly picks a time, then reads “FIRE.” At that point the “FIRE” button must be pushed. Then is shows your time, and sits there until you push the start button again.

What I am looking to do is… Plug it in and push the start button to begin the loop, go through the “FIRE” stage, then I would like it to display the reaction time for about 2000ms then immediately start another “FIRE” stage and do 5 loops of this. After the five loops I want it to go all the way back to the very beginning and wait for the “start” button to be pushed.

Can please get some feedback on the direction I need to take to accomplish this?

#include <LiquidCrystal.h>

LiquidCrystal lcd(7, 6, 5, 4, 3, 2);

int lcdRedPWMPin = A3;    // red channel RGB lcd
int lcdGreenPWMPin = A2;    // green channel RGB lcd
int lcdBluePWMPin = A1;    // blue channel RGB lcd

void setDisplayRGB(int r, int g, int b)
{
  analogWrite(lcdRedPWMPin,   r);  // using PWM pins, means any shade
  analogWrite(lcdGreenPWMPin, g);  //  of red, green, blue
  analogWrite(lcdBluePWMPin,  b);  //  2^24 combinations
}

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

pinMode(9, INPUT); //panel button
digitalWrite(9, HIGH);
  
  pinMode(8, INPUT); //FIRE button
  digitalWrite(8, HIGH);
  
  pinMode(10, OUTPUT); //FIRE led
  digitalWrite(10, LOW);
 }
double i = 0; //time it took to (fire-trigger)
double a = millis(); //fire (timer starts)
double c ; //trigger (timer stops)
int b; //random


void loop()
{
  //delay(500);
  while(digitalRead(9) == HIGH)
{
  lcd.clear();
  setDisplayRGB(0,255,0); //purple 0,255,0
  lcd.setCursor(0,0);
  lcd.print("Press Button");
  lcd.setCursor(0,1);
  lcd.print("to Start ...");
  delay(1000);
} 
 
  lcd.clear();
   lcd.setCursor(0,0);
   setDisplayRGB(255,255,0);
  lcd.print("  ---READY---");
  
  delay((int)random(1000, 5000));
{

b = random(1,3);
Serial.println(b);
if( b == 1)
        lcd.clear(); 
        lcd.setCursor(0,0); 
        setDisplayRGB( 0, 255, 255 );
        lcd.print("     <FIRE>   "); 
        
        
  digitalWrite(10, HIGH);
   a = millis();
   while(digitalRead(8) == HIGH)
    
   {
    c = millis(); 
   }
  digitalWrite(10, LOW);
  setDisplayRGB(0,0,0);
}

   i = (c - a) / 1000;
delay(500);
 //lcd.clear();
while(digitalRead(9) == HIGH)
{
    lcd.clear();
    setDisplayRGB(0,255,0);
   lcd.setCursor(0,1);
  lcd.print(i);
     lcd.setCursor(11,1);
   lcd.print("Sec's");
  lcd.setCursor(0,0);
  lcd.print("Your time was ...");
  //lcd.setCursor(0,0);
  delay(125);

}
}

I'm going to suggest you do this first. Format that code. Have you ever noticed how the code written by pros is always formatted so nice so that all the blocks line up and you can see the logic flow without having to read all the code and hunt down the braces? We don't do that just because it is pretty. It will help you get a grip on the logic which is about to get a little more complex. Let's get on top of that before it becomes a real mess. The IDE will do it for you even, just press control - T and then come back and edit that post with the formatted code. I promise it's going to help make things easier for all of us.

int lcdRedPWMPin = A3;    // red channel RGB lcd
int lcdGreenPWMPin = A2;    // green channel RGB lcd
int lcdBluePWMPin = A1;    // blue channel RGB lcd

You can't do PWM on the pins that share space with the analog pins.

double a = millis(); //fire (timer starts)

millis() does NOT return a double. It returns an integral number of milliseconds.

double i = 0; //time it took to (fire-trigger)
double a = millis(); //fire (timer starts)
double c ; //trigger (timer stops)
int b; //random

NONE of these names means a damned thing. Quit being lazy. Press a few more keys and use meaningful names. Then, you can leave the useless comments off.