fix
This commit is contained in:
@ -73,18 +73,19 @@ int currentStateLeftButton = digitalRead(leftButton);
|
|||||||
int currentStateRightButton = digitalRead(rightButton);
|
int currentStateRightButton = digitalRead(rightButton);
|
||||||
int currentStateArmTwo = ServoArmTwo.read();
|
int currentStateArmTwo = ServoArmTwo.read();
|
||||||
Serial.print("button: ");
|
Serial.print("button: ");
|
||||||
Serial.print(leftButton);
|
Serial.print(currentStateLeftButton);
|
||||||
Serial.print(rightButton);
|
Serial.print(currentStateRightButton);
|
||||||
Serial.print("\n");
|
Serial.print("\n");
|
||||||
|
|
||||||
while (leftButton == HIGH) {
|
if (currentStateLeftButton == HIGH) {
|
||||||
|
Serial.print("test");
|
||||||
|
|
||||||
int newStateArmTwo = currentStateArmTwo + 1;
|
int newStateArmTwo = currentStateArmTwo + 1;
|
||||||
ServoArmTwo.write(newStateArmTwo);
|
ServoArmTwo.write(newStateArmTwo);
|
||||||
delay(15);
|
delay(15);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (rightButton == HIGH) {
|
if (currentStateRightButton == HIGH) {
|
||||||
int newStateArmTwo = currentStateArmTwo - 1;
|
int newStateArmTwo = currentStateArmTwo - 1;
|
||||||
ServoArmTwo.write(newStateArmTwo);
|
ServoArmTwo.write(newStateArmTwo);
|
||||||
delay(15);
|
delay(15);
|
||||||
|
|||||||
Reference in New Issue
Block a user