 volatile unsigned long tachDuration1 = 0;
 volatile unsigned long tachDuration2 = 0;
 volatile unsigned long tachLast = 0;
-volatile unsigned int ignitionMode = OFF;
-volatile int remainingCount = 0;
+volatile byte ignitionMode = OFF;
+volatile byte remainingCount = 0;
 volatile bool updateTimer = false;
+int loopsSinceSerialWrite = 0;
 long period = 0;
 
 // -------------------------

    case WAIT:
      return DWELL;
  }
}

// -------------------------

// -------------------------
#define OFF 0
#define DWELL 1
#define FIRE 2
#define MF_WAIT 3
#define MF_DWELL 4
#define MULTIFIRE 5
#define WAIT 6

// -------------------------
//        Settings
// -------------------------
const bool debug = true;        //true = write to serial monitor, false = bypass
const int serialOutLoops = 5;   //Number of loops that should execute before a serial write
//Ignition Settings
const int dwell = 2500;         //Ignition coil charging dwell in microseconds (2.5ms = 2500us)
const long periodMax = 1000000; //Maximum period between ignitions, in microseconds (min frequency)
