   delay(1000);
   digitalWrite(KEY_PIN, HIGH);
   delay(1000);
-  Serial.begin(9600);
   btSerial.begin(9600);
 }
 

  // Happened to me one of 4-5 times on average, running without any delay functions.
  // That's why we need a delay that will switch output ON immediately, but turn OFF with a delay to compensate for false negatives
  delaySwitch(output);
}

// Switch ON immediately, while delay switching OFF


// Array for device addresses and expected return to match name
#define NUM_DEVICES 2 // should match number of elements below
struct BluetoothDevices {
  // MAC addresses of recognized bluetooth devices. Format: 0000,00,000000
  static const String address[NUM_DEVICES];
  // Expected response of device name, starting with "+RNAME:"
  static const String name[NUM_DEVICES];
};
// Actual device names and addresses are stored in include file
#include "BluetoothDevices.h"

// Some state variables to keep track of things
int currentState = LOW;
