#include <ACB_ARM.h>//Add the Robot arm libraries
ACB_ARM ARM;

void setup() {
  ARM.Chassis_angle_adjust(8);//Default 0
  ARM.Slight_adjust(0,2);//Default(0,0)
  ARM.ARM_init(5,16,17,18);//The parameters are four Servo pins
  Serial.begin(115200);
}
void loop() {
  if (Serial.available()) {
    String input = Serial.readStringUntil('\n');
    int x, y, z, claws;//Define variables for coordinates x, y, z, and claws
    sscanf(input.c_str(), "%d %d %d %d", &x, &y, &z, &claws);
    if (claws < 90 || claws > 180) {
      Serial.println("Invalid claw value. Claw value must be between 90 and 180.");
      return;
  }
  Serial.print("X:");
  Serial.print(x);
  Serial.print(",Y:");
  Serial.print(y);
  Serial.print(",Z:");
  Serial.print(z);
  Serial.print("  Claws Angle:");
  Serial.print(claws);
  Serial.println(" ");
  ARM.ClawsCmd(claws);
  delay(1000);
  ARM.PtpCmd(x, y, z);
  }
}

