   while (!Serial);
   AbsoluteMouse.begin();
   attachInterrupt(digitalPinToInterrupt(2), interrupt, RISING); //interrupt pin from Mega
-  //Serial.println("Ready");
+  Serial.println("Ready");
 }
 
-
-
-void loop() {
-  if (state == CLICK){
+void clickMouse(){
+    if (state == CLICK){
     delay(500); //delay so if there's another interrupt it will change state
   }
   

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


AltSoftSerial mySerial;
int missedPackets = 0;

enum states {
  NO_CLICK,
