I came back to using my uArm Metal after putting it aside for a few months, and now I cannot get it to move consistently using uArm.MoveTo. I have verified that the uArm is receiving the correct coordinates. The weird thing is that the gripper will still actuate, but the uArm does not move after receiving the first coordinates. The arduino code that I am using is pasted below, and I am using v1.7.1. I have tried the following (none of which work):
- Using uArm.run() in both the setup and loop sections.
- Using both int and double as the input type
- Changing the serial delay time and adding arbitrary delays between commands
- Checking the wiring
Would appreciate any help. Please see code below:
`#include “uArm.h”
double x; double y; double z; int g;
int g_old = 2;
void setup() {
Serial.begin(9600);
Serial.setTimeout(100);
Serial.println(“Connection Established”);
uArm.setup();
Serial.println(“uArm Intialized”);
Serial.println(“Ready for Use”);
}
void loop() {
for(int i = 0; i <= 3; i++){
if(Serial.available() > 0){
if(i==0){
x = Serial.parseInt();
Serial.print("X: ");
Serial.println(x);
}
else if(i==1){
y = Serial.parseInt();
Serial.print("Y: ");
Serial.println(y);
}
else if(i==2){
z = Serial.parseInt();
Serial.print("Z: ");
Serial.println(z);
}
else{
g = Serial.parseInt();
Serial.print("G: ");
Serial.println(g);
}
}
else{
i–;
}
}
uArm.run();
Serial.println(“Sending Command”);
uArm.moveTo(x, y, z, 0.5);
if (g_old != g){
if(g == 1){
uArm.mController.gripperCatch();
g_old = g;
}
else if(g == 0){
uArm.mController.gripperRelease();
g_old = g;
}
}
Serial.println(“Command Sent”);
}`