Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit 16-channel PWM/Servo Shield vs Stepper Motor/Servo
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit 16-channel PWM/Servo Shield vs Stepper Motor/Servo

by BPerry on Mon Aug 10, 2020 6:02 pm

I had previously used a Stepper motor/servo shield and programmed my two servos with ease using servo.attach(90) type commands. With your Adafruit 16-channel PWM/Servo Shield it seems to require using pwm.setPWM(servonum, 0, pulselen) type statements which I am having difficulty with. All I need to do is move 6 servos from 0 to 90 degrees together. I can't seem to figure out how to do this using this shield. I was using your Adafruit PWM Servo Driver Library>Servo example code to get started. Any help would be greatly appreciated!
Bob

BPerry
 
Posts: 4
Joined: Mon Aug 10, 2020 5:53 pm

Re: Adafruit 16-channel PWM/Servo Shield vs Stepper Motor/Se

by adafruit_support_bill on Mon Aug 10, 2020 7:05 pm

Start with the example code from the library. That has default definitions for SERVOMAX and SERVOMIN. Those are good starting points for most servos, but may need to be tweaked a bit for best accuracy.
To move a servo to 0 degrees:
Code: Select all | TOGGLE FULL SIZE
pwm.setPWM(servonum, 0, SERVOMIN);

To move it to 90 degrees:
Code: Select all | TOGGLE FULL SIZE
pwm.setPWM(servonum, 0, (SERVOMAX - SERVOMIN) / 2);

adafruit_support_bill
 
Posts: 78759
Joined: Sat Feb 07, 2009 10:11 am

Re: Adafruit 16-channel PWM/Servo Shield vs Stepper Motor/Se

by BPerry on Tue Aug 11, 2020 10:14 am

Thank you very much! Everything works great now.

BPerry
 
Posts: 4
Joined: Mon Aug 10, 2020 5:53 pm

Please be positive and constructive with your questions and comments.