Getting error when uploading code to arduino

I purchased the all in one kit from DFRobots that includes the ROMEO Microcontroller (ATMega 328). I try uploading the object avoid code into the Arduino IDE and I get this error:

avrdude stk500_recv programmer is not responding

 

I've searched and know I'm choosing the correct board and serial. In fact I've tried them all and get the same error. I've even changed the usb cable and same results. Others who have had this error say the board could be bad, I'm hoping thats not the case, any suggestions would help.

 

Below is my code I found:

 

 

OBJECT AVOIDING ROBOT CODE FOR ARDUINO - ADAFRUIT MOTORSHIELD - PARALLAX PING )) - TAMIYA DUAL MOTOR GEARBOX

 

CODE ADAPTED, COPIED, MODIFIED, AND STOLEN IN GENERAL FROM VARIOUS PLACES AROUND THE INTERNET BY GRINAN BARRETT JULY 4TH/5TH 2008

 

THIS CODE IS FREE TO ANYONE THAT WISHES TO USE IT, MODIFY IT, OR STEAL IT IN GENERAL.. HAVE FUN WITH IT!

 

This code will let you program a bot that will roam around looking for things to avoid running into.  The code is pretty simple, but gave me major fits figuring out.  Espeically the interaction with the 

the parallax ping )) ultrasonic range finder.  The main thing to remember is the intialization of the ping unit.. it has to be exact.. once i saw i was running to tight a loop on it.. things got much easier.. ( thanks collin)

if nothing else, this code will let you have the basics of a roving bot with ping capability, it's up to you to do cool stuff with it.

 

*/

 

byte ultraSoundSignal = 14;

unsigned long dist = 0;

 

// ***************************   SETTING UP THE PROGRAM  *********************************** 

void setup()

{

 Serial.begin(9600); 

 //motor.setSpeed(200);          // sets motor 1 speed to 200

 //motor2.setSpeed(200);          // sets motor 2 speed to 200

 

 pinMode(ultraSoundSignal, OUTPUT);  // sets enable as output

 

 straight();                    // initializes go straight

}

 

// ***************************   MAIN PROGRAM LOOPS  *********************************** 

void loop() {

distCalc();                                

avoidObjects();                             

delay(20);    

Serial.println(dist);  //     ADDED TO APPEND DISTANCE TO SERIAL MONITOR SO I COULD SEE PROBLEMS.. 

delay(250); 

}

// ***************************   MAIN STRAIGHT ROUTINE  *********************************** 

void straight(){

  //motor.run(FORWARD);

  //motor2.run(FORWARD);

  Serial.print("Forward Hoooo!");  // ADDED SO I COULD SEE PROBLEMS WITH SERIAL MONITOR

}

// ***************************   MAIN TURNING ROUTINE  *********************************** 

void turnRight() 

{

   //motor.run(BACKWARD);

   //motor2.run(FORWARD);

   Serial.print("Turning Right!!");// ADDED SO I COULD SEE PROBLEMS WITH SERIAL MONITOR

}

 

// ***************************   PING FUNCTIONS TO GET DISTANCES  *********************************** 

float distCalc() // distance calculating function converts analog input to inches

{

 pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output

 digitalWrite(ultraSoundSignal, LOW); // Send low pulse

 delayMicroseconds(2); // Wait for 2 microseconds

 digitalWrite(ultraSoundSignal, HIGH); // Send high pulse

 delayMicroseconds(5); // Wait for 5 microseconds

 digitalWrite(ultraSoundSignal, LOW); // Holdoff

 pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input

 digitalWrite(ultraSoundSignal, HIGH); // Turn on pullup resistor

 

 unsigned long echo = pulseIn(ultraSoundSignal, HIGH); //Listen for echo

 dist = (echo / 58.138) * 0.39; //convert to CM then to inches

 

 return dist;

}

 

// ***************************   THE AVOIDING OBJECTS ROUTINE  *********************************** 

void avoidObjects()

{

 if(dist < 8)                            // if the distance is less than 8 inches

 {

   Serial.print("object detected closer than allowed!!!");   // ADDED SO I COULD SEE PROBLEMS WITH SERIAL MONITOR

   turnRight();                            // turns right using turnRight function

   delay(100);

 }

 else                                      // otherwise

 {

   straight();                            // go straight using the straight function

   Serial.print(" continuing forward ");  //  ADDED SO I COULD SEE PROBLEMS WITH SERIAL MONITOR

 }

}


One thing you might try is

One thing you might try is to press the reset button on the board right before it uploads the code.

 

ya tried that and even reset

ya tried that and even reset after pressing the upload and same thing

It looks like your listing is missing

the first /* at the very begining. That shouldn’t affect your programmer being recognized or not though. Doesn’t your programmer have an activity LED that says ‘hey, I’m plugged in?’ One last stupid question, the USB port you are plugging into is known to work, right?

Sorry that got cut off when I pasted the code

Sorry that got cut off when I pasted the code. And yes the board does have a red power LED and green flashing tx light. And yes my USB ports work it powers the device and my other arduino 2560 mega. 

Are you able to upload other

Are you able to upload other code, like the blinker?

I will try that when I get

I will try that when I get home. I doubt it will work my macbook doesnt even see the board.

Same error, I even tried

Same error, I even tried both USB ports

Change the COM port.

Change the COM port.

change com port on what and

change com port on what and how?

On the PCStart Arduino IDE (

On the PC

Start Arduino IDE ( Compiler) then go to Tools >> Serial Port

If you have : COM3, COM4, etc

Try switching those COM ports and don’t forget to select your right board ( Tools >> Board)

Cheers

I dont have com ports this

I dont have com ports this is what I have:

Screen_Shot_2011-08-20_at_7_02_45_PM.png

I could be wrong, but,

it would seem that your Mac is not recognizing your programmer being plugged in. I know with linux I can open a console and type lsusb and it will list all the usb devices that are connected. A search revealed that “system_profiler SPUSBDataType” entered in a console/terminal will give a list of all usb connected devices. I don’t know what the list will look like, but, I would imagine that you should see something that will give you an idea as to whether or not your programmer is being recognized or not. If you don’t see something that rings any bells try once with the programmer plugged in and then retry without it plugged in to see what different hardware is listed.

Ok, you’re missing the USB

Ok, you’re missing the USB ports. Try this.

Delete Arduino from Apps and download it again. Install it and then plug your cable and select your board. I have a Pro and works excellent.

Next go to serial port and select the one that doesn’t shows Bluetooth. Now upload your code. Cheers.

PD: Tomorrow I’ll post some screens.

** I uninstalled the Arduino**

Screen_Shot_2011-08-21_at_1_48_12_PM.png

 

I uninstalled the Arduino software, grabbed the latest version and I thought I was on to something when there was an additional USB software file for older boards I remember I neve installed since I had a mega 2650n and was not needed. So after the reboot, I saw the 2 USB serial in the Serial drop down and chose the first one. No go, chose the second one same thing, switched cables and ports, still a no go. I even chose a different board and was alerted by the Arduino software that I selected the wrong board. My machine doesnt see the board at all, I go to system preferences and network and it shows my mega 2650 not the AtMega328.

This is just a stab in the

This is just a stab in the dark, but try adding external power to your board.

The board is attached to a

The board is attached to a battery pack, I wasnt sure if I should turn that on in addition to it being powered via USB. Will it harm the board?

I can’t see why. And

I can’t see why. And it’s worth a try.

 

Same error

Same error

I tried using my daughters

I tried using my daughters laptop running XP and now I get this error:

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

I’v tried everything on the official arduino website here and nothing worked:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1248528012/all

You think the board is bad?