 // 0 : off
 // 1 : on --> power on
 
-int AC_TEMPERATURE = 27;
+volatile int AC_TEMPERATURE = 27;
 // temperature : 18 ~ 30
 
-int AC_FLOW        = 0;
+volatile int AC_FLOW        = 0;
 // 0 : low
 // 1 : mid
 // 2 : high

    ac_power_down();
    Serial.println("CHANGE AC MODE : OFF");
  }
}

// IR
void dumpInfo(decode_results *results)
{
  Serial.println("IR code received");

  if ( results->bits > 0 && results->bits == 32 ) {
    switch (results->value) {
      // sleep mode start / stop
      case 0x77E1203C:
        ac_startMills = millis() + 1799900;
        Serial.println("IR : Sleep Mode Change");
        sleepmode = !sleepmode;
        break;

      // ac power down
      case 0x77E1403C:
        Serial.println("IR : AC Power Down");
        ac_power_down();
        break;

      // temp up
      case 0x77E1D03C:
        if ( AC_TEMPERATURE < 30 ) {
          ac_activate((AC_TEMPERATURE + 1), AC_FLOW);
        }
        break;

      // temp down
      case 0x77E1B03C:
        if ( AC_TEMPERATURE > 18 ) {
          ac_activate((AC_TEMPERATURE - 1), AC_FLOW);
        }
        break;

      // flow up
      case 0x77E1E03C:
        if ( AC_FLOW < 3) {
          ac_activate(AC_TEMPERATURE, (AC_FLOW + 1);
        }
        break;

      // flow down
      case 0x77E1103C:
        if ( AC_FLOW > 0) {
          ac_activate(AC_TEMPERATURE, (AC_FLOW - 1);
        }      
        break;

    }
  }

  delay(50);
  irrecv.resume(); // Continue receiving
}


*/

IRrecv irrecv(IR_receive_recv_PIN); // Receive on pin 6
IRsend irsend;

// ------------------------------------------
int samplingTime = 280;
