Go Down

Topic: [SOLVED] Arduino uno stuck on "uploading" (Read 28347 times) previous topic - next topic

TheTurtleKing

Jul 13, 2014, 06:22 am Last Edit: Jul 14, 2014, 07:50 pm by TheTurtleKing Reason: 1
it keeps saying "uploading"

can i get my code checked?




int time = 30;

void setup(){
 //start serial connection
 Serial.begin(9600);
 //configure pin2 as an input and enable the internal pull-up resistor
 pinMode(0, INPUT_PULLUP);
 pinMode(2, INPUT_PULLUP);
 pinMode(7, OUTPUT);

}

void loop(){
 //read the pushbutton value into a variable
 int switchVal = digitalRead(2);
 int sensorVal = digitalRead(0);
 //print out the value of the pushbutton
 Serial.println("Sensor" + sensorVal);
 Serial.println("Switch" + switchVal);
 
 // Keep in mind the pullup means the pushbutton's
 // logic is inverted. It goes HIGH when it's open,
 // and LOW when it's pressed. Turn on pin 13 when the
 // button's pressed, and off when it's not:
 if (sensorVal == HIGH && switchVal == LOW) {
tone(7, 3000, time*4);
delay(time*4);
tone(7, 2800, time*4);
delay(time*4);
 }
 else {
   
 }
}




TheTurtleKing


it keeps saying "uploading"

can i get my code checked?




int time = 30;

void setup(){
  //start serial connection
  Serial.begin(9600);
  //configure pin2 as an input and enable the internal pull-up resistor
  pinMode(0, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(7, OUTPUT);

}

void loop(){
  //read the pushbutton value into a variable
  int switchVal = digitalRead(2);
  int sensorVal = digitalRead(0);
  //print out the value of the pushbutton
  Serial.println("Sensor" + sensorVal);
  Serial.println("Switch" + switchVal);
 
  // Keep in mind the pullup means the pushbutton's
  // logic is inverted. It goes HIGH when it's open,
  // and LOW when it's pressed. Turn on pin 13 when the
  // button's pressed, and off when it's not:
  if (sensorVal == HIGH && switchVal == LOW) {
tone(7, 3000, time*4);
delay(time*4);
tone(7, 2800, time*4);
delay(time*4);
  }
  else {
   
  }
}







turns out it even gets stuck loading on the "bare minimum" example. helppp?

TheTurtleKing


.


tried doing that "DFU" thing, uploaded a new hex (i think)
still wont run. am i reseting the board correctly?

TheTurtleKing

attempted a loop back test,
it just spit out data from my previous upload, and kept spitting out data

what now?

steinie44

Why are you using pin 0?
Pins 0 and 1 are used to upload by the USB cable.
Don't use pins 0 and 1.

TheTurtleKing


Why are you using pin 0?
Pins 0 and 1 are used to upload by the USB cable.
Don't use pins 0 and 1.



Thanks, noted.
problem is still not fixed, however.

spycatcher2k

Marked as solved - please share your solution with us.
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

TheTurtleKing

[solved]
not exactly sure how i solved it.
from what i remember doing, i rebooted my computer and uploading the bare-minimum example into the computer.

bare-minimum example (found on arduino's example guides)
Code: [Select]

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:
 
}

ltfrockli

I have experienced this recently, the problem came from board setting was set to another board for unknown reason. After choosing a correct board, it could be uploaded.

Cheers,
Rock Li

PeerlessProgrammer

I had this happen to me on an UNO R3. I solved the issue by disabling Bluetooth on my laptop. It was causing a conflict on COM5.

I had ruled out the board, cable, and IDE. Finally noticed in Device Manager that COM5 had entries (one being the Arduino and the other being Bluetooth). This was on Windows 10 Pro.

Hope that helps someone else that might have this issue in the future.

Go Up