I’m still playing around with robot arms, and to reduce the weight at the effector end I thought I’d swap out my MG996R and replace it with an HD-9110MG.
Both are 6V compatible but the HD is a digital rather than analogue servo.
I thought the “digital” was to do with the electronics inside, but that I could still treat them the same - have I got the wrong idea here ?
I’m driving all the servos in the arm from an Adafruit 16-channel PWM shield.
Does this code still make sense with a mix of servo types ?
Cheers,
David
// default address 0x40
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// servo arrays
...
// setup
void setup() {
pwm.begin();
pwm.setPWMFreq(60); // Analog servos run at ~60 Hz updates
delay(10);
for (int i = 0 ; i < SERVOS ; i++){
currPos[i] = servostart[i];
targetPos[i] = servostart[i];
}
}
loop()
{
// check various things and set the target position for each servo
...
// now move the servos
for (int i = 0 ; i < SERVOS ; i++){
currPos[i] = targetPos[i];
pwm.setPWM(i, 0, currPos[i]);
}
}