           if(((float) currentTemp) > ((float) TEMP_HIGH))
           {
             daikin_cooling_on();
+            resend = 0;       // reset the sending count
             timeElapsed = 0;  // reset mode-switch timer
           }
           else
           {
             daikin_dehumidifier_on();
+            resend = 0;       // reset the sending count
             timeElapsed = 0;  // reset mode-switch timer
           }
         }


  // =================================================================================================================================

  // delay a minutes until next reading
  delay(60000);



  // reset the air conditioning control
  isOn = MODE_OFF;
  resendTimer = 0;

  // needs no UART echo
  String qmoteCmd = "ATE0\r\n";
