 const byte ARMED_LED = 4;
 const byte FIRING_LED = 5;
 
+// Managing debounce of the button used to FIRE!
+long lastDebounceTime = 0;
+long debounceDelay = 250;
+
+// We'll hold timing information about certain states here
+long timerStartupState = 0;
+long timerFiringState = 0;
+
 // FSM states
 State startupState = State(enterStartupState,updateStartupState,leaveStartupState);
+State readyState = State(enterReadyState,updateReadyState,leaveReadyState);
 State armedState = State(enterArmedState,updateArmedState,leaveArmedState);
 State firingState = State(enterFiringState,updateFiringState,leaveFiringState);
 


// FSM state callback methods

void enterStartupState() {}
void updateStartupState() {}
void leaveStartupState() {}

void enterArmedState() {}
void updateArmedState() {}
void leaveArmedState() {}

void enterFiringState () {}
void updateFiringState() {}
void leaveFiringState() {}

// Timing helpers
void startTimer(long &timer) {

FSM stateMachine = FSM(startupState);

void setup() {
  pinMode(TRIGGER_BUTTON, INPUT_PULLUP);
  pinMode(ARMING_SWITCH, INPUT);
  pinMode(ARMED_LED, OUTPUT);
  pinMode(FIRING_LED, OUTPUT);
  
  attachInterrupt(1,fireEvent,HIGH);

  startLog();
}

void fireEvent() {
  if ((millis() - lastDebounceTime) > debounceDelay) {
    if (stateMachine.isInState(armedState)) {
      stateMachine.transitionTo(firingState);
    }
    lastDebounceTime = millis();
  }
}

void loop() {
