 #include "CampFireGFX.h"
 
 void setup() {
-  Serial.begin(115200);
+  Serial.begin(9600);
   setSyncProvider(RTC.get);
   SetupDisplayLayout();
   irrecv.enableIRIn();
+  Serial.println("Enter AT commands:");
+  BTserial.begin(9600);
+  //at("AT+NAMECaravanTX");
+  //at("AT+ROLE1");
+  //at("AT+RESET");
+  delay(1000); // wait a bit, NECESSARY!!
+  at("AT+INQ");
+  // Master Address 00:15:83:00:84:F7
+  // Slave Address 00:15:83:00:83:EE
+  //at("Hello World!!");
 }
 
 void loop() {
   // Read the Temperature
   ReadTemperature();
   ReadTime();
-  CheckIR(); // This has the delay of 2000ms
-}
-
+  //CheckIR(); // This has the delay of 2000ms
+  CheckBT(); // This has a delay of 2000ms
+
+}
+
+void CheckBT()
+{
+  BTCheckLoop++;
+  if (BTCheckLoop == 5)
+  {
+    Serial.println("Trying To Pair");
+    at("AT+CONN1");
+    Serial.println("Paired");
+  }
+  BTCheckTime = millis() + 2000;
+  while (BTCheckTime > millis())
+  {
+    if (BTserial.available())
+    {
+      Serial.write(BTserial.read());
+    }
+
+    // Keep reading from Arduino Serial Monitor and send to HC-06
+    if (Serial.available())
+    {
+      BTserial.write(Serial.read());
+    }
+  }
+}
 void CheckIR()
 {
   IRCheckTime = millis() + 2000;

  {
    TFTscreen.drawBitmap(TFTscreen.width() - 45, 36, CampFireFlames, 40, 44, Black);
  }

  TFTscreen.drawBitmap(TFTscreen.width() - 45, 80, CampFireLogs, 40, 12, Brown);
}


dht DHT;
IRrecv irrecv(IRPIN);
decode_results results;
SoftwareSerial BTserial(BLERXPIN, BLETXPIN); // RX, TX

// Define Global Variables

