Open bbhxwl opened 2 years ago
if(Serial.available()){
String inputCOM = Serial.readStringUntil('\n'); // m-move:20,30,-1
if(inputCOM.indexOf("m-move:") != -1){
inputCOM.replace("m-move:", "");
inputCOM.replace(" ", "");
String xVal = inputCOM.substring(0,inputCOM.indexOf(","));
inputCOM.remove(0, xVal.length()+1);
String yVal = inputCOM.substring(0,inputCOM.indexOf(","));
inputCOM.remove(0, yVal.length()+1);
String wheel = inputCOM.substring(0);
//Serial.println(xVal + "," + yVal + "," + wheel);
bleMouse.move(atoi(xVal.c_str()), atoi(yVal.c_str()), atoi(wheel.c_str()));
}
}