Go Down

Topic: "Upload complete" displays but code doesn't execute--problem with USB? (Read 514 times) previous topic - next topic

Kirook

I am trying to upload code to an Arduino Uno to use with the MeArm robot kit. When I press "Upload", the IDE displays "Upload complete", but the Arduino does not execute the code and the robot does not move.

This may be related to a problem with USB detection--I have checked Device Manager and the device in the COM port does not register as an Arduino. However, the Uno still has power and can run the basic "Blink" sketch.

I have also tried switching to another Uno and to a Pro, and switching the USB connector cable, but the same problem has appeared every time.

Has anyone else encountered this issue? Is there a known fix?

sterretje

Please provide a schematic diagram how you have wired everything; photo/scan of hand-drawn one is fine.
Please provide your code (between code tags [code] and [/code]; if it's too big, attach it).

If the blink sketch works, you have a wiring, power or code problem; you can try a simple serial test program to test communication.

E.g. the below will echo what you type in serial monitor.
Code: [Select]

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  if(Serial.available() > 0)
  {
    Serial.write(Serial.read());
  }
}
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Kirook

Here is the code:

Code: [Select]
#include <Servo.h>
 
Servo middle, left, right, claw ;  // creates 4 "servo objects"
 
void setup()
{
  Serial.begin(9600);
  middle.attach(11);  // attaches the servo on pin 11 to the middle object
  left.attach(10);  // attaches the servo on pin 10 to the left object
  right.attach(9);  // attaches the servo on pin 9 to the right object
  claw.attach(6);  // attaches the servo on pin 6 to the claw object
}
 
void loop()
{
  middle.write(90); // sets the servo position according to the value(degrees)
  left.write(90); // does the same
  right.write(90); // and again
  claw.write(25); // yes you've guessed it
  delay(300); // doesn't constantly update the servos which can fry them
}


And here is a diagram of the MeArm wiring, which I have checked several times to make sure I have followed exactly.
 

sterretje

No real knowledge of Servos and steppers. Have you tried with a single servo (disconnect the others).

If you can upload, there is no USB issue. I have a Sparkfun RedBoard that also does not register as an Uno; reason (as far as I know) is that it uses the FTDI chip for the USB communicastion which is generic.
If you understand an example, use it.
If you don't understand an example, don't use it.

Electronics engineer by trade, software engineer by profession. Trying to get back into electronics after 15 years absence.

Go Up