Fixed buttonPress

This commit is contained in:
2022-09-04 11:47:33 +02:00
parent 76962684a4
commit 5830335c84

View File

@@ -254,28 +254,26 @@ void joystickButtonPress() {
} }
} }
if(!abort) { for(int i = 0; i < CodeLenght; i++) {
for(int i = 0; i < CodeLenght; i++) { Serial.print(String(Code[i]));
Serial.print(String(Code[i])); }
} Serial.println(" Len:" + String(CodeLenght));
Serial.println(" Len:" + String(CodeLenght));
if(Code[0] == 0 && Code[1] == 1 && Code[2] == 0 && Code[3] == 1 && CodeLenght == 4) {
if(Code[0] == 0 && Code[1] == 1 && Code[2] == 0 && Code[3] == 1 && CodeLenght == 4) { Serial.println("Calibrate...");
Serial.println("Calibrate..."); calibrateMaxMin();
calibrateMaxMin(); } else if(Code[0] == 0 && CodeLenght == 1 && AutoplayOn == true) {
} else if(Code[0] == 0 && CodeLenght == 1 && AutoplayOn == true) { Serial.println("Save position...");
Serial.println("Save position..."); savePos();
savePos(); } else if(Code[0] == 1 && CodeLenght == 1 && AutoplayOn == true) {
} else if(Code[0] == 1 && CodeLenght == 1 && AutoplayOn == true) { Serial.println("Start Autoplay...");
Serial.println("Start Autoplay..."); autoplayStart = true;
autoplayStart = true; autoplayLoop = 0;
autoplayLoop = 0; inAutoplay = true;
inAutoplay = true; attached(true);
attached(true); } else if(Code[0] == 0 && Code[1] == 0 && CodeLenght == 2 && AutoplayOn == true) {
} else if(Code[0] == 0 && Code[1] == 0 && CodeLenght == 2 && AutoplayOn == true) { Serial.println("Clear positions...");
Serial.println("Clear positions..."); clearPos();
clearPos();
}
} }
} }