   pinMode(PWM_PIN, OUTPUT);
   pinMode(FAN_PIN, OUTPUT);
   Serial.begin(9600);
+  HWSerial.begin(9600);
   //Wait for the serial pins to connect (May only be needed for Leonardo board)
-  while (!Serial) {}
+  while (!HWSerial) {}
   CommandPacket* cmd = getCommand(OPEN);
   sendCommand(cmd);
   free(cmd);

  CommandPacket* cmd = getCommand(CLOSE);
  sendCommand(cmd);
  free(cmd);
  Serial.end();
  setup();*/
}


{
  //Read bytes waiting if data is not found
  long i = 0;
  //long j = 0;
  for (i = 0; i < len;)
  {
    int b = HWSerial.read();
    if (b == -1)
    {
      /*for (j = 0; j < i+1; j++) {
