       }
     }
 
-    int tap2Pulses = _tap2Pulses;
+    long tap2Pulses = _tap2Pulses;
     if(lastTap2Pulses != 0 && lastTap2Pulses == tap2Pulses) {
       // complete
       _tap2Pulses = 0;

    delay(1000);
  }
}


// main loop - once a second, check the accumulated pulse counts and send the STOP/CONTINUE/IGNORE message as necessary
// send an ALIVE message every loop to assist debugging
void loop() {
  long lastTap1Pulses = 0;
  long lastTap2Pulses = 0;
  while(true) {
    long tap1Pulses = _tap1Pulses;
    if(lastTap1Pulses != 0 && lastTap1Pulses == tap1Pulses) {
      // complete
      _tap1Pulses = 0;
