 #include "HID-Project.h"
-#include <SoftwareSerial.h> //a dependancy to allow us to differentiate input from the pi and from the mega
 #include <AltSoftSerial.h>
 
 //  See HID Project documentation for more infos


enum states state = NO_CLICK;

//SoftwareSerial mySerial(10 , 11);

void interrupt() {
  //AbsoluteMouse.moveTo(32767,32767);
  //detachInterrupt(digitalPinToInterrupt(2));
  switch(state) {
    case NO_CLICK:
      state = CLICK;

  if (mySerial.available()) {
    cmd = (mySerial.readStringUntil('.'));
    mySerial.println(cmd);
    Serial.println(cmd);
    String dx = cmd.substring(0,5);
    String dy = cmd.substring(5,10);
    Serial.println(dx + " " + dy);
    int x = dx.toInt();
    int y = dy.toInt();
    AbsoluteMouse.moveTo(x,y);
  }
  
}
