Hi! We (my students and I) are having fun with the gripper bot, in combination with a roboboard X4. We’re trying to get the gripper arm to work. We now can make the arm move (after we turned the connectors the right way up …) But if we try to get the servo angle, we always get 180 degrees. Surely, we are missing something obvious. Help would be much appreciated.
our sketch:
#include <Arduino.h>
void setup() {
Serial.begin(9600);
X4.servoB.setSpeed(30); // 30 RPM
}
void loop() {
// Angle control [90:180]
for (int i = 90; i <= 180; i++) {
X4.servoB.angle(i); // Spin to angle i
Serial.printf("Pos: %4d%%, Angle: %3d, Pulse: %4dus\n",
X4.servoB.getPos(),
X4.servoB.getAngle(),
X4.servoB.getPulse()
);
delay(100);
}
}
And the serial gave:
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
Pos: 100%, Angle: 180, Pulse: 6144us
The servo was moving, the serial never changed.