     pinMode(SEG_PIN + i, INPUT);
   }
 
-  pinMode(PIN_ON_OFF, OUTPUT);
-  digitalWrite(PIN_ON_OFF, HIGH);
-  pinMode(PIN_MODE, OUTPUT);
-  digitalWrite(PIN_MODE, HIGH);
-  pinMode(PIN_FAN, OUTPUT);
-  digitalWrite(PIN_FAN, HIGH);
-  pinMode(PIN_INC, OUTPUT);
-  digitalWrite(PIN_INC, HIGH);
-  pinMode(PIN_DEC, OUTPUT);
-  digitalWrite(PIN_DEC, HIGH);
+  pinMode(PIN_ON_OFF, INPUT);
+  pinMode(PIN_MODE, INPUT);
+  pinMode(PIN_FAN, INPUT);
+  pinMode(PIN_INC, INPUT);
+  pinMode(PIN_DEC, INPUT);
+
+  pinMode(PIN_ON_OFF_READ, INPUT);
 }
 
 void loop() {

  Serial.println((const char *)root["cmd"]);

  if (strcmp(root["cmd"], "on_off") == 0) {
    digitalWrite(PIN_ON_OFF, LOW);
    delay(SIM_BTN_DELAY);
    digitalWrite(PIN_ON_OFF, HIGH);
  } else if (strcmp(root["cmd"], "mode") == 0) {
    digitalWrite(PIN_MODE, LOW);
    delay(SIM_BTN_DELAY);
    digitalWrite(PIN_MODE, HIGH);
  } else if (strcmp(root["cmd"], "fan") == 0) {
    digitalWrite(PIN_FAN, LOW);
    delay(SIM_BTN_DELAY);
    digitalWrite(PIN_FAN, HIGH);
  } else if (strcmp(root["cmd"], "inc") == 0) {
    digitalWrite(PIN_INC, LOW);
    delay(SIM_BTN_DELAY);
    digitalWrite(PIN_INC, HIGH);
  } else if (strcmp(root["cmd"], "dec") == 0) {
    digitalWrite(PIN_DEC, LOW);
    delay(SIM_BTN_DELAY);
    digitalWrite(PIN_DEC, HIGH);
  } else if (strcmp(root["cmd"], "get") == 0) {
    g_need_report = 1;
  }

  g_step = 1;
}

void press_btn(int pin) {
    pinMode(pin, OUTPUT);
    digitalWrite(pin, LOW);
    delay(SIM_BTN_DELAY);
    pinMode(pin, INPUT);
}

void handle_msg() {
  StaticJsonBuffer<256> jsonBuffer;

