Pages: [1]   Go Down
Author Topic: Servo example not uploading/problem  (Read 750 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am trying to control a simple servo. I am going off this site to help me http://www.azega.com/arduino-servo-motor-part-1/ and I have it wired up just like in the picture. I am using the code from File>Examples>Servo>Sweep  I haven't modified the code at all. It compiles successfully but when I try to upload this shows up-
avrdude: stk500_getsync(): not in sync: resp=0x30
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Anyone know what the problem is and how I can fix it?

Any replies will be well appreciated, Thank You. Here's the code if anyone need to look at it.

// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.


#include <Servo.h>
 
Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created
 
int pos = 0;    // variable to store the servo position
 
void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
 
void loop()
{
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
  {                               
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
}
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 24
Posts: 1207
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

disconnect usb - unhook servo - plug in usb - upload sketch - unhook usb - hook up servo - plug in usb


If this does not work its not a servo issue, let us know what happens.



Drew.
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I am trying to control a simple servo. I am going off this site to help me http://www.azega.com/arduino-servo-motor-part-1/ and I have it wired up just like in the picture. I am using the code from File>Examples>Servo>Sweep  I haven't modified the code at all. It compiles successfully but when I try to upload this shows up-
avrdude: stk500_getsync(): not in sync: resp=0x30
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51


That is an upload error, nothing to do with the sketch or the servo. That error means the Arduino IDE can't communicate with the board. Can you upload anything, like the simple blink example? Some common causes for that error are:

Not selecting proper comm port number in the arduino IDE
Not selecting the proper board type in the Arduino IDE
Not installing the PC USB serial driver software properly

Lefty
Logged

Scotland
Offline Offline
Edison Member
*
Karma: 24
Posts: 1207
Have you had your Arduino fix today?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

or its a faulty servo pulling loads of current from the arduino. Been there myself  smiley-eek
Logged

Drew.
http://www.uk-pcb.co.uk - My UK Based PCB Fab & Assembly Company
Design work undertaken
SMD & Thru-Hole assembly

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

or its a faulty servo pulling loads of current from the arduino. Been there myself  smiley-eek

Yes, could be. That's why I asked if he had ever uploaded blink succesfully. If so he could just unwire the servo and see if he can then upload OK or not. We will just have to wait for his response(s).

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

disconnect usb - unhook servo - plug in usb - upload sketch - unhook usb - hook up servo - plug in usb

I've tried this and the upload error continued to show up.

I also tried uploading the simple blink example and the error still proceeded.

So next I think I should try the options below. How do I know if I've done them correctly or done them at all? and if No how do I?

Quote
Not selecting proper comm port number in the arduino IDE
Not selecting the proper board type in the Arduino IDE
Not installing the PC USB serial driver software properly


Thank You for all your responses! I am destine to figure this out!
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17259
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://arduino.cc/en/Guide/Troubleshooting
Logged

Pages: [1]   Go Up
Jump to: