🚀 Uploading Your Code with Arduino IDE

Introduction

Welcome back to our IoT journey! 👋
In the previous post
, we installed the Arduino IDE and configured it to recognize our ESP32 board.

Now, it’s time to bring our board to life by uploading our very first program — the classic …


This content originally appeared on DEV Community and was authored by Mohamed Ahmed

Introduction

Welcome back to our IoT journey! 👋
In the previous post
, we installed the Arduino IDE and configured it to recognize our ESP32 board.

Now, it’s time to bring our board to life by uploading our very first program — the classic “Blink”. This small project will make the onboard LED on your ESP32 blink at regular intervals — a simple but exciting sign that everything is working!

🧰 What You’ll Need

  • Your ESP32 development board (e.g., ESP32 DevKit C)
  • A USB cable (connected to your computer)
  • The Arduino IDE (already configured for ESP32)

Step 1: Open the Arduino IDE

Launch the Arduino IDE on your computer.
Make sure your ESP32 is connected to your PC via USB.

🧩 Step 2: Select the Correct Board and Port

Before writing any code, confirm that you’ve selected your ESP32 board and port correctly:

  • Go to Tools → Board → ESP32 Arduino → ESP32 Dev Module
  • Go to Tools → Port → select the one that says something like COM7

_💡 If no port is visible, you may need to install the USB driver for your board (CH340 or CP210x depending on your model). You can check the chip model next to your USB port.
_

💻 Step 3: Write the Blink Code

In your Arduino IDE, copy and paste the following code:

// The classic Blink program for ESP32
int ledPin = 2; // Built-in LED on most ESP32 boards is on GPIO 2

void setup() {
  pinMode(ledPin, OUTPUT); // Initialize the LED pin as an output
}

void loop() {
  digitalWrite(ledPin, HIGH); // Turn the LED on
  delay(1000);                // Wait 1 second
  digitalWrite(ledPin, LOW);  // Turn the LED off
  delay(1000);                // Wait 1 second
}

Explanation:

  • setup() runs once when your board starts.
  • loop() runs continuously, making the LED turn on and off.
  • delay(1000) means 1000 milliseconds (1 second).

⚠️ If the upload fails, try holding the BOOT button on your ESP32 while uploading.

⬆️ Step 4: Upload the Code

Now the fun part! 🎉
Click the Upload button (the right-pointing arrow in the toolbar).

Your IDE should look like this:
You should see messages like “Compiling…” and “Uploading…” at the bottom.
When it finishes, the onboard LED should start blinking once per second.
ESP32 should look like this
LED not blinking Some boards use different pins for the built-in LED. Try changing int ledPin = 2; to int ledPin = 5; or int ledPin = 13;

💡 If the LED isn’t blinking, some boards use different pins for the built-in LED. Try changing int ledPin = 2; to int ledPin = 5; or int ledPin = 13;.

🎯 What’s Next
You’ve just taken your first successful step into IoT programming!
In the next post, we’ll explore how to read sensor data and display it using the Serial Monitor.

Until then — happy tinkering! 🔧✨

*Did your LED blink? *😄
Share your success (or any errors you faced) in the comments — I’d love to help you troubleshoot and celebrate your first ESP32 project!


This content originally appeared on DEV Community and was authored by Mohamed Ahmed


Print Share Comment Cite Upload Translate Updates
APA

Mohamed Ahmed | Sciencx (2025-10-05T16:09:46+00:00) 🚀 Uploading Your Code with Arduino IDE. Retrieved from https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/

MLA
" » 🚀 Uploading Your Code with Arduino IDE." Mohamed Ahmed | Sciencx - Sunday October 5, 2025, https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/
HARVARD
Mohamed Ahmed | Sciencx Sunday October 5, 2025 » 🚀 Uploading Your Code with Arduino IDE., viewed ,<https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/>
VANCOUVER
Mohamed Ahmed | Sciencx - » 🚀 Uploading Your Code with Arduino IDE. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/
CHICAGO
" » 🚀 Uploading Your Code with Arduino IDE." Mohamed Ahmed | Sciencx - Accessed . https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/
IEEE
" » 🚀 Uploading Your Code with Arduino IDE." Mohamed Ahmed | Sciencx [Online]. Available: https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/. [Accessed: ]
rf:citation
» 🚀 Uploading Your Code with Arduino IDE | Mohamed Ahmed | Sciencx | https://www.scien.cx/2025/10/05/%f0%9f%9a%80-uploading-your-code-with-arduino-ide/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.