     cmdMessenger.copyString(buf, 350);
     // Its of the form int, where int is percent
     // duty cycle
-    dutyCycle = dutyCycle = atoi(buf);
-    Serial.print(dutyCycle);
-    // Check bounds
-    if (dutyCycle > 100)
-      dutyCycle = 100;
-    if (dutyCycle < 0)
-      dutyCycle = 0;
+    setDutyCycle(atoi(buf));
   }
 }
 

unsigned long windowStartTime;
boolean inDutyCycleMode;
boolean heaterIsOn;

void heaterOn() {
  digitalWrite(heaterPin, HIGH);

  kSEND_CMDS_END, // Mustnt delete this line
};

#define STATMSG "1,"
#define ENDMSG ";\r\n"

// Commands we send from the PC and want to recieve on the Arduino.
// They start at the address kSEND_CMDS_END
messengerCallbackFunction messengerCallbacks[] =
