Arduino IDE get stuck while uploading sketch I was trying to use my L293D motor driver module. But when I upload the following sketch to try and run my motor, but it would get stuck on "Uploading". This happens with this sketch only, and happens randomly, with odds of happening being 3 in 5 times. After a bit fiddling around I found an error  


  Programmer is not responding.


When I try to reset the board or just reconnect it to my PC it might work.
Here's the sketch- 

int RightMotorForward = 12;
int RightMotorReverse = 13;


void setup()
{
  pinMode(RightMotorForward, OUTPUT);
  pinMode(RightMotorReverse, OUTPUT); 
}

void loop()

{
   digitalWrite(RightMotorForward, HIGH);
   delay(10000);

   digitalWrite(RightMotorForward,LOW);
   delay(1000);
}


Can anybody point out where I am going wrong? I am using Arduino UNO. Is this just some problem in my code?
Is the motor driver connected to the Arduino while you program it? 

When the Arduino is reset, the output pins on the Arduino are driven high. If too much current is drawn though any of these pins, then the voltage supply to the ATMega328 may drop, and the ATMega328 gets stuck in a brownout.