 
   pinMode(10, INPUT);
   pinMode(8, INPUT);
-  
-//  digitalWrite(HC_05_SETUPKEY, HIGH);  // Set command mode when powering up
-  
+
+
+  digitalWrite(HC_05_SETUPKEY, LOW);
+
+  //delay(CMD_W);       
+  digitalWrite(HC_05_PWR1, HIGH);
+  digitalWrite(HC_05_PWR2, HIGH);  
+  //delay(CMD_W);
+                
   Serial.begin(9600);   // For the Arduino IDE Serial Monitor
   BTSerial.begin(38400);  // HC-05 default speed in AT command mode
-
-  bt->setState(data);
 
   if (pressure.begin())
     Serial.println("BMP180 init success");
   else
     Serial.println("BMP180 init failed!!!");
 
-/*
-  msg("Pwr on");
-  delay(2000);
-  
-  msg("Applying VCC Power. LED should blink SLOWLY: 2 Seconds ON/OFF");
-  
-  digitalWrite(HC_05_PWR1, HIGH); // Power VCC
-  digitalWrite(HC_05_PWR2, HIGH);  
-  
-  delay(2000);
-
-  Serial.println("Enter AT commands in top window.");
-  BTSerial.begin(38400);  // HC-05 default speed in AT command mode
-*/
-
+  sensors.begin();
 }
 
 int cnt = 0;

  d10 = digitalRead(10);
  d8 = digitalRead(8);

  char status;

  float h = dht.readHumidity();
  float t = dht.readTemperature();

  if (board == 0) {
    status = getPT(P, T);
    
    bt_echo_send("(")
    fbt_echo_send(cnt); 
    fbt_echo_send(v0); 
    fbt_echo_send(-1);
    fbt_echo_send(t);
    fbt_echo_send(v1); 
    fbt_echo_send(d8);
    fbt_echo_send(d10);
    fbt_echo_send(T);
    fbt_echo_send(P);
    fbt_echo_send(h);
    bt_echo_send(")")

    bt_echo_send("\r\n")
        
    delay(100);
  }
  cnt++;
}


double H = -0.0;

#define bt_echo_send(x) Serial.print(x); BTSerial.print(x);
#define fbt_echo_send(x) bt_echo_send(#x); bt_echo_send(" "); bt_echo_send(x); bt_echo_send(" ");


int getPT(double &P, double &T) {
