Arduino code compiling but not uploading

Hello :). I was writing code for a humidity sensor and ended up overheating and breaking the module (DHT11). However, after unplugging the Arduino and later successfully compiling my new code, it still read out lines from my previous code in the Serial Monitor

Humidity Reading Error: Error: Reading from DHT11 timed out.
Temperature Reading Error: Error: Reading from DHT11 timed out.
Humidity Reading Error: Error: Reading from DHT11 timed out.
etc....

I attempted to upload the basic blink code and alas despite successful compiling in the IDE, the Arduino did not blink.

It blinks upon resets and plugging in and out, the Arduino isn't overheating anywhere, and upon inspection and cleaning does not have any debris or faults. The TX consistently blinks as if it is receiving information from the DHT11 (which btw worked until I played around with it). It passes a perfect 5V too.

Everything seems fine, except that the code doesn't transfer. I've tried from multiple USB ports across my laptop and PC. I tried using a different connection cord too. It's like I burned the code into the board.

Does anyone know a solution, or is it safe to say it's fried?

Thank you :slight_smile:

The easiest answer is to say it is fried but that in not a given. Post the output of the compiler when compiling and uploading. Be sure you have the correct board selected and on some the correct boot loader. While you are thinking about it remove all the hardware and see if you can upload.

1 Like

If an upload is attempted and fails, an error message will be output. Please post the full error message.

1 Like

Hi, thank you for your response. Here is an image of the output after compiling, during compiling its just the standard loading bar ("Compiling sketch...") and a small popup that says "Done compiling" after it's complete. Below attached is the serial monitor output and once again the example blink command does not work.

Hey, thank so much you for your reply. No error message is displayed at all, it compiles as usual, yet the new code doesn't seem to clear the old code.

Hi @youngthugman. Please try this experiment and then report back with the results:


:exclamation: This procedure is not intended to solve the problem. The purpose is to gather more information.


  1. Select File > Preferences... (or Arduino IDE > Settings... for macOS users) from the Arduino IDE menus.
    The "Preferences" dialog will open.
  2. Uncheck the box next to Show verbose output during: compilation in the "Preferences" dialog.
  3. Check the box next to Show verbose output during: ☐ upload.
  4. Check the box next to ☐ Verify code after upload.
  5. Click the "OK" button.
  6. Attempt an upload, as you did before.

Now please reply here on the forum thread with the following information:

  • Did the upload process succeed this time?
  • If the upload failed, the full text of the upload output, as shown in the "Output" panel at the bottom of the Arduino IDE window.
1 Like

Hello, thank you for your time and reply. I have adjusted my preferences as instructed:

The output remains the same:

Once more the Arduino does not blink, the TX still blinks as before.

It seems that you are only compiling the sketch, which is typically done by clicking the checkmark button on the Arduino IDE toolbar. That only verifies that the compiler considers the code valid. It doesn't change the program that is running your your Arduino board. The "it still read out lines from my previous code in the Serial Monitor" symptom you report is normal and expected if you only compiled the new sketch, since the old sketch program will still be running on your Arduino board.

If you want to change the sketch program that is running on the Arduino board then you must perform an Upload operation. That is typically done by clicking the rightward pointing arrow button on the Arduino IDE toolbar.

Please do this:

  1. Select Sketch > Upload from the Arduino IDE menus.
  2. Wait for the upload process to finish.

Now please reply here on the forum thread with the following information:

  • Did the upload process succeed?
  • If the upload was successful, is the behavior of the Arduino board now as you expect?
  • If the upload failed, the full text of the upload output, as shown in the "Output" panel at the bottom of the Arduino IDE window.
1 Like

This has to be the dumbest mistake I have ever done :sob: . Thank you for your time and I'm so sorry :sob:

1 Like

You are welcome. I'm glad if I was able to be of assistance.

You have nothing to apologize for. Even though Arduino does try to make it as friendly as possible, there is still a lot of unavoidable complexity when we are working with embedded systems. We are all guaranteed to make many mistakes along our learning journeys.

Regards,
Per

1 Like

You would be hard pressed to find one of us who has not done the same or similar thing. Many times when we find a mistook it is something similar to what we have already done. We are glad it is now working.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.