new cad and fixes
This commit is contained in:
@ -17,8 +17,8 @@ void setup () {
|
||||
Serial.begin(9600);
|
||||
pinMode(SW_pin, INPUT);
|
||||
digitalWrite(SW_pin, HIGH);
|
||||
pinMode(leftButton, INPUT_PULLUP);
|
||||
pinMode(rightButton, INPUT_PULLUP);
|
||||
pinMode(leftButton, INPUT);
|
||||
pinMode(rightButton, INPUT);
|
||||
|
||||
|
||||
}
|
||||
@ -42,10 +42,14 @@ int currentYState = ServoBase.read();
|
||||
if (Y_State > 524) {
|
||||
int newYState = currentYState + 1;
|
||||
ServoBase.write(newYState);
|
||||
Serial.print("arm base movement");
|
||||
Serial.print("\n");
|
||||
delay(15);
|
||||
}else if (Y_State < 502) {
|
||||
int newYState = currentYState - 1;
|
||||
ServoBase.write(newYState);
|
||||
Serial.print("arm base movement");
|
||||
Serial.print("\n");
|
||||
delay(15);
|
||||
}
|
||||
|
||||
@ -58,11 +62,15 @@ int currentXState = ServoArmOne.read();
|
||||
if (X_State > 524) {
|
||||
int newXState = currentXState + 1;
|
||||
ServoArmOne.write(newXState);
|
||||
Serial.print("arm one movement");
|
||||
Serial.print("\n");
|
||||
delay(15);
|
||||
|
||||
}else if (X_State < 502) {
|
||||
int newXState = currentXState - 1;
|
||||
ServoArmOne.write(newXState);
|
||||
Serial.print("arm one movement");
|
||||
Serial.print("\n");
|
||||
delay(15);
|
||||
}
|
||||
|
||||
@ -72,10 +80,10 @@ int currentXState = ServoArmOne.read();
|
||||
int currentStateLeftButton = digitalRead(leftButton);
|
||||
int currentStateRightButton = digitalRead(rightButton);
|
||||
int currentStateArmTwo = ServoArmTwo.read();
|
||||
Serial.print("button: ");
|
||||
/*Serial.print("button: ");
|
||||
Serial.print(currentStateLeftButton);
|
||||
Serial.print(currentStateRightButton);
|
||||
Serial.print("\n");
|
||||
Serial.print("\n");*/
|
||||
|
||||
if (currentStateLeftButton == HIGH) {
|
||||
Serial.print("test");
|
||||
|
||||
Reference in New Issue
Block a user