# Hướng dẫn nạp chương trình Arduino IDE

## 1. Hướng dẫn nạp ví dụ "blink" (nháy LED) trên Arduino

&#x20;    Nạp ví dụ "blink" trên Arduino IDE cho arduino; Mục đích hiển thị blink (nháy) led số 13 ngay trên arduino Uno

&#x20;    Bạn có thể thấy đèn LED 'L' trên bo mạch Arduino của bạn đã nhấp nháy khi bạn kết nối nó với phích cắm USB. Điều này là do bo mạch Arduino thường được xuất xưởng với bản test 'Blink' được cài đặt sẵn.\
\
&#x20;    ***Trong bài học này***, chúng ta sẽ lập trình lại Arduino bằng ví dụ mẫu test Blink của riêng mình và sau đó thay đổi tốc độ nhấp nháy của nó.

### 1.1. Mở ví dụ "Blink" trong Arduino IDE

&#x20;    Mở ví dụ 'Blink' trong mục Example( ví dụ) của Arduino IDE; Cụ thể vào File → Examples → 01.Basics -> Blink

<figure><img src="https://cdn-learn.adafruit.com/assets/assets/000/002/146/medium800/learn_arduino_opening_blink_example.jpg?1396779947" alt=""><figcaption></figcaption></figure>

&#x20;     Khi cửa sổ phác thảo (sketch) được mở ra, hãy phóng to nó để bạn có thể nhìn thấy toàn bộ bản phác thảo trong cửa sổ.

<figure><img src="https://cdn-learn.adafruit.com/assets/assets/000/002/147/medium800/learn_arduino_ide_blink.jpg?1396779953" alt=""><figcaption></figcaption></figure>

### 1.2 Kết nối Arduino Uno với PC qua cáp USB type B

<figure><img src="/files/rM7HqA9ievRNsBT1qiDb" alt=""><figcaption></figcaption></figure>

### 1.3 Chọn bảng mạch, chọn cổng kết nối

* Chọn bảng mạch: Tools -> Board -> Arduino AVR boards -> Arduino Uno
* Chọn cổng kết nối: Tools -> Port -> (*<mark style="color:red;">Chọn cổng tương ứng - cái mà cắm arduino vào sẽ hiện</mark>*)

<figure><img src="/files/GUPYnBsih2j0k31bbgrk" alt=""><figcaption></figcaption></figure>

### 1.4 Biên dịch và nạp chương trình vào Arduino Uno

* Click chữ "V" để biên dịch chương trình (ĐỂ KIỂM TRA CHƯƠNG TRÌNH CÓ LỖI KHÔNG?);
* Click "->" để nạp chương trình vào board Arudino Uno

<figure><img src="/files/vfaXm88jmSX6unNmPrfU" alt=""><figcaption></figcaption></figure>

Vậy là bạn đã nạp thành công ví dụ "NHÁY LED" lên arduino uno.

## 2. Video nạp ví dụ "Blink"  (nháy led) lên Arduino

{% embed url="<https://www.youtube.com/watch?v=7xBOm4lrpiY>" %}


---

# 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/huong-dan-nap-chuong-trinh-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.
