sync and protocol error

I am trying to run a dc motor using the code provided in the tutorial
#include <AFMotor.h>

AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm

void setup() {
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Motor test!");

motor.setSpeed(200); // set the speed to 200/255
}

void loop() {
Serial.print("tick");

motor.run(FORWARD); // turn it on going forward
delay(1000);

Serial.print("tock");
motor.run(BACKWARD); // the other way
delay(1000);

Serial.print("tack");
motor.run(RELEASE); // stopped
delay(1000);
}

It compiles with no problem
however, When I try to upload the sketch
i get the following errors

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

I don't know what the how to go about it. Help please!

Try the suggestions in the troubleshooting guide.

I was searching around the forum for help with my arduino 'issue' and came across your post. I was having the error:

avrdude: stk500_getsync(): not in sync: resp=0x00
avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

when I started up by arduino. I was wondering if you figured out your problem. I solved this problem by uninstalling the FTDI drivers but I think more importantly changing the USB post AND changing the com port. I have seen this many times on machines that one USB port is not always equal to others. Also go into the IDE/Tools/Serial Port and try ALL the com ports listed one by one and reload the sketch each time. I have found the resetting the button did nothing for me, btw.
Good Luck,
Oaxacamatt1