# Lập trình Board ESP32 trên Arduino IDE

## 1. Hướng dẫn thêm Board ESP32 vào Arduino IDE

(1)Mở IDE arduino, nhấp vào Tệp > Tùy chọn, như hiển thị bên dưới:

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FLEjgLxTC5RjAlCe7K3K4%252F20.png%3Falt%3Dmedia&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=23ecc113&#x26;sv=2" alt=""><figcaption></figcaption></figure>

（2)Sao chép liên kết:

<https://dl.espressif.com/dl/package_esp32_index.json>

（3） Mở nút được đánh dấu bên dưới :

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FbZ41SV0lBpQwuywVxVG5%252Fimage.png%3Falt%3Dmedia%26token%3D3ec05458-652d-4172-824d-2a97dea45bd0&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=5d0f07ae&#x26;sv=2" alt=""><figcaption></figcaption></figure>

(4) Dán vào bên trong và nhấn OK như hình bên dưới

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FSdF8p68MraOUmLufWM8V%252Fimage.png%3Falt%3Dmedia%26token%3D90461c51-8359-42b2-a2c6-f4d933a6ac25&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=cf46d337&#x26;sv=2" alt=""><figcaption></figcaption></figure>

(5) Nhấp vào Công cụ > Bảng > Trình quản lý bảng

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FZrTvyC4JwBCr628K57wX%252Fimage.png%3Falt%3Dmedia%26token%3Dff115b20-8d86-41c2-a69d-99117f71428a&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=ff7bed4&#x26;sv=2" alt=""><figcaption></figcaption></figure>

(6) Tìm ESP32 từ Trình quản lý bảng bật lên rồi nhấp vào cài đặt.

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FqEAkJwjYAycgvqa4cvSf%252Fimage.png%3Falt%3Dmedia%26token%3Da9c50926-6251-4bc2-8e78-a4d8a51c76c0&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=1f74b592&#x26;sv=2" alt=""><figcaption></figcaption></figure>

(7) Nhấp vào Công cụ > Bảng để xem Arduino ESP32

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252FJ2OE6CXTBkvnN49lGhhK%252Fimage.png%3Falt%3Dmedia%26token%3D8d088456-c90d-4619-b414-3efa89e4b2aa&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=111a6c65&#x26;sv=2" alt=""><figcaption></figcaption></figure>

## 2. Hướng dẫn tải lên chương trình lên ESP32: <a href="#id-4.2.-huong-dan-tai-len-chuong-trinh-len-esp32" id="id-4.2.-huong-dan-tai-len-chuong-trinh-len-esp32"></a>

* Mở code ESP32 từ file có sẵn; hoặc code đang lập trình;
* Vào Tools (**Số 1)** trên Arduino IDE, chọn Board Esp32 (chọn Board ESP32 tương ứng phiên bản bạn đang sử dụng) **(Số 2)**;
* Sau đó, trong Tools chọn cổng Com tương ứng Tools **(Số 3)**;
* Nhấn vào nút nạp chương trình **(Số 4)** để tải chương trình lên bảng điều khiển ESP32.

<figure><img src="https://wiki.linhkientot.vn/~gitbook/image?url=https%3A%2F%2F1988159175-files.gitbook.io%2F%7E%2Ffiles%2Fv0%2Fb%2Fgitbook-x-prod.appspot.com%2Fo%2Fspaces%252Fy0hrCFvdopltnkPlQqTJ%252Fuploads%252Fk1FOD3kEKl8gw3aDsMRl%252Fimage.png%3Falt%3Dmedia%26token%3Da825483c-fb89-4169-9128-6bfbfc49e638&#x26;width=768&#x26;dpr=4&#x26;quality=100&#x26;sign=224d56a7&#x26;sv=2" alt=""><figcaption></figcaption></figure>

NHƯ VẬY LÀ CHÚNG TA ĐÃ CÓ THỂ DÙNG ARDUINO IDE ĐỂ LẬP TRÌNH CHO ESP32.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.linhkientot.vn/arduino-products/huong-dan-ban-dau-arduino-ide/lap-trinh-board-esp32-tren-arduino-ide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
