Skip to main content

ESP32 First Program Guide

Espressif ESP32 Logo

Connect Your Board & Select It in the IDE

  1. Plug your ESP32 into your computer using a USB cable.

  2. In the Arduino IDE, go to Tools → Board → esp32 and select your exact board (e.g. ESP32 Dev Module).

  3. Go to Tools → Port and select the port your board appears on:

    • Windows: COM3, COM4, etc.
    • macOS: /dev/cu.usbserial-XXXX or /dev/cu.SLAB_USBtoUART
    • Linux: /dev/ttyUSB0
  4. Set Tools → Upload Speed to 115200 if you run into upload errors.

If no port appears, double-check the USB cable (some are charge-only) and that the driver is installed correctly — see Hardware Setup.


Run a Test Sketch

  1. Open File → Examples → 01.Basics → Blink.
  2. Click Upload. Some ESP32 boards require holding the BOOT button while the IDE shows "Connecting..." for the upload to start.
  3. The onboard LED should start blinking once your sketch runs.

Want a guided walkthrough with wiring and code explanations? Check out the LED Blink tutorial.


Troubleshooting

  • "A fatal error occurred: Failed to connect to ESP32" — hold the BOOT/FLASH button on the board while uploading starts, then release once it begins.
  • Port doesn't show up — install the correct USB driver — see Hardware Setup — and try a different USB cable.
  • Garbled text in Serial Monitor — make sure the monitor's baud rate matches your sketch's Serial.begin() value (commonly 115200).

What's Next?


Comments