Basic Sketch for Servo Shield

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
ama530
 
Posts: 4
Joined: Tue Jan 28, 2014 11:23 pm

Basic Sketch for Servo Shield

Post by ama530 »

Hi everyone,

New to the Arduino. My son and I would like to find out if anyone has a basic sketch for an Adafruit Servo Shield controlling 1-3 servos. I understand the code for a single servo wired directly to the Arduino and have no problems. But I am having a problem trying to understand the code that is on the tutorial for the shield. I understand most code but I can't wrap my head around this for some reason. The only movement I get from the servo sketch is slight movements until it hits its limit and stops. It is a TowardPro MG996R. LCDs, steppers, LEDs, etc.. I'm good with. This is driving me a little nuts. Any help or advice would be much appreciated.

Thanx,
Chris & Aaron

User avatar
Franklin97355
 
Posts: 23938
Joined: Mon Apr 21, 2008 2:33 pm

Re: Basic Sketch for Servo Shield

Post by Franklin97355 »

Two questions, does your servo work when you wire it directly into the Arduino and have you tried some of the examples (or this http://learn.adafruit.com/3d-printed-an ... robot-head)

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: Basic Sketch for Servo Shield

Post by adafruit_support_bill »

The example code that comes with the library sequences through all 16 channels and sweeps each servo back and forth. Does that code work for you?

ama530
 
Posts: 4
Joined: Tue Jan 28, 2014 11:23 pm

Re: Basic Sketch for Servo Shield

Post by ama530 »

Hey guys,

Sorry it took me so long to reply. Yes, the servo works when I have it wired to the Arduino directly. I can run the example sketches in the software. Sweep, Knob, etc... When I use the servo shield with the Adafruit 'servo' sketch it just rotates ccw at like 30° increments until it hits the stop. I have another mini servo from Radio Shack that just goes ballistic and slams into the stop and starts grinding like mad. I have the servo connected to pin set 0.

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: Basic Sketch for Servo Shield

Post by adafruit_support_bill »

the servo works when I have it wired to the Arduino directly.
Good. That rules out a problem with the servo.
When I use the servo shield with the Adafruit 'servo' sketch it just rotates ccw at like 30° increments until it hits the stop.
Definitely sounds like a problem with the servo shield. If you can post some clear photos of the front and back of the shield we'll check for any assembly issues.

ama530
 
Posts: 4
Joined: Tue Jan 28, 2014 11:23 pm

Re: Basic Sketch for Servo Shield

Post by ama530 »

Please see attached. I have no solder bridges and everything is pretty sano.
Attachments
Assembly
Assembly
P1010675.JPG (420.44 KiB) Viewed 404 times
Top View
Top View
P1010674.JPG (460.81 KiB) Viewed 404 times
Bottom View
Bottom View
P1010673.JPG (415.31 KiB) Viewed 404 times

User avatar
adafruit_support_bill
 
Posts: 88140
Joined: Sat Feb 07, 2009 10:11 am

Re: Basic Sketch for Servo Shield

Post by adafruit_support_bill »

I don't see any problems there. If you contact [email protected] with a link to this thread we can send you out a new shield.

ama530
 
Posts: 4
Joined: Tue Jan 28, 2014 11:23 pm

Re: Basic Sketch for Servo Shield

Post by ama530 »

Will do. Thank you for your assistance.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”