9

I am trying to upload this simple sketch into my arduino with a shield I made. It takes forever (note I have the right COM port on)

  int sensorValue = 0;

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

  void loop(){
     sensorValue = analogRead(A4);
     delay(10000000);
     Serial.println(sensorValue); 
     delay(10000000);
  }
user3704293
  • 471
  • 7
  • 19
Diana Lc
  • 125
  • 1
  • 2
  • 6

6 Answers6

10

Are you sure the problem is in the upload time? delay() takes the number of milliseconds you want to wait. In your code, it should take about 3 hours before the Arduino sends some data through the serial port.

FrancoVS
  • 213
  • 2
  • 5
7

I had the same problem. I noticed that the RX & TX LEDs we're not flashing as they normally do when I upload a file. I'm using an older knock off nano.

My solution: Under Tools> processor.... I switched from the defaulted "ATmega328P" to the "ATmega328P(Old Bootloader)" option. The next upload attempt was quick and successful. Normal flashing RX &TX LEDs during the upload as well. Hope this helps someone.

2

Check the end of this thread for the reply by 'Toshibass', Unbelievable slow compilation of simple sketches

I was having same same problem compile took > 3 minutes for small sketch using serial or OTA however I found solution The program that was slowing down compile was IBM's Trusteer .. Rapport which is a fraud prevention program distributed by my bank once I de-installed it, same compile took 10 seconds, now all I need to do is find an alternative or hope IBM produce a fix after I filled in a issue report to them.

It worked for me, the culprit was some software called 'Trusteer'.

Greenonline
  • 3,144
  • 7
  • 36
  • 48
1

If the problem does indeed lie in the upload (see DoubtBearer's answer), then you should turn on verbose output, to see exactly what part of the upload is giving issues.

In your IDE, click File -> preferences; look for the section "Show verbose output during:" and tick both Compilation and Upload.

Re-run your upload, and see what is taking up all the time. If you can't figure it out from that, please post the log (it will appear in the black area at the bottom of the IDE, you should be able to cut & paste).

AMADANON Inc.
  • 2,383
  • 10
  • 9
1

If you are taking too much time for uploading means there is communication between another device is happening, please remove all TX and RX pins.

kiran b
  • 21
  • 1
0

Try downloading CH340 drivers. You must not have drivers for uploading the code to arduino board and to identify the right COM port. Download and install the drivers, find the COM port number from device manager and update Tools->Port in your Arduino IDE.