         cbi(PORTC, PORTC6);     // digitalWrite(S_DEC1, LOW);
         cbi(PORTD, PORTD7);     // digitalWrite(S_DEC2, LOW);
     }
+}
+
+
+// -------------------------------------------------------------------------------------------------
+void delayPeriod(byte expectedSingal)
+{
+    timeoutStart = millis();
+    while (SignalsReceived < expectedSingal) 
+    {
+        if ((millis() - timeoutStart) > TIMEOUT_PERIOD) { break; }
+    }
+    
+    delay(ROUND_DELAY);
 }
 
 

    range[3]  = (timeRight - timeStart) / SCALE_FACTOR;
    range[9]  = (timeLeft - timeStart) / SCALE_FACTOR;

    analogRange[12] = analogRead(AN12);
    analogRange[3] =  analogRead(AN3);
    analogRange[9] =  analogRead(AN9);

 
//****** ROUND 3 ***************************************************************
    // Gray code; only one bit changes at a time
    boardState = ROUND3;
    SignalsReceived = 0;       
    //Send a pulse on sonars 
    //digitalWrite(S_DEC1, HIGH);
    setRound(1, 1);
    
    timeoutStart = millis();
    while (SignalsReceived < EXPECTED_SIGNALS3) 
    {
        if ((millis() - timeoutStart) > TIMEOUT_PERIOD) { break; }
    }
    delay(ROUND_DELAY);

    //==== extra interrupt data holders for timing tests ========
    //    timeLeftStartSet = false;

volatile unsigned long timeCenter;

volatile unsigned long timeStart;
// volatile unsigned long timeLeftStart;       //currently not being used
// volatile unsigned long timeRightStart;      //currently not being used
// volatile unsigned long timeCenterStart;     //currently not being used

volatile bool timeStartSet;
// volatile bool timeLeftStartSet;             //currently not being used
// volatile bool timeRightStartSet;            //currently not being used
// volatile bool timeCenterStartSet;           //currently not being used

//For SPI communications
volatile unsigned long timeWriteStart;
volatile byte valueIn;
volatile bool processIt;

int range[RANGE_DATA_SIZE]{};
int analogRange[RANGE_DATA_SIZE]{};

int roundCount, timeoutStart, timeSinceLastRound;
byte boardCount; //just the front board

volatile int isr1Count, isr2Count, isr3Count;

const byte SCALE_FACTOR = 58;   //to calculate the distance, use the scale factor of 58us per cm
const int BAUD_RATE = 115200;

// -------------------------------------------------------------------------------------------------
void setup()
