mirror of
https://github.com/LinoSchmidt/RoboterArm.git
synced 2026-03-21 02:31:16 +01:00
Fixed buttonPress
This commit is contained in:
40
src/main.cpp
40
src/main.cpp
@@ -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();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user