       break;
   }
 
-  // commands from the pi terminate with '.'
-  char cmd[11] = "";
-  char cmd2[11] = ""; // sse parity \o/
-
   // check if byte available on the software serial port
   //receives zero-padded string of 16 bit coordinates (xy) ending with a '.'
   if (mySerial.available()) {
     mySerial.readBytesUntil('.', cmd, 11);
-    while (!mySerial.available()) {}
     mySerial.readBytesUntil('.', cmd2, 11);
 
     String cmdStr = String(cmd);


AltSoftSerial mySerial;
int missedPackets = 0;

enum states {
  NO_CLICK,

      if (missedPackets >= 15){
        missedPackets = 0;
        mySerial.readBytesUntil('.', cmd, 11);
      }
      //Serial.println("Packet miss");      
    }
