diff --git a/roboterarm/roboterarm.ino b/roboterarm/roboterarm.ino index 6a718aa..03fa574 100644 --- a/roboterarm/roboterarm.ino +++ b/roboterarm/roboterarm.ino @@ -73,18 +73,19 @@ int currentStateLeftButton = digitalRead(leftButton); int currentStateRightButton = digitalRead(rightButton); int currentStateArmTwo = ServoArmTwo.read(); Serial.print("button: "); -Serial.print(leftButton); -Serial.print(rightButton); +Serial.print(currentStateLeftButton); +Serial.print(currentStateRightButton); Serial.print("\n"); -while (leftButton == HIGH) { +if (currentStateLeftButton == HIGH) { + Serial.print("test"); int newStateArmTwo = currentStateArmTwo + 1; ServoArmTwo.write(newStateArmTwo); delay(15); } -while (rightButton == HIGH) { +if (currentStateRightButton == HIGH) { int newStateArmTwo = currentStateArmTwo - 1; ServoArmTwo.write(newStateArmTwo); delay(15);