Hướng dẫn cài đặt arduino 1.8.9

The new major release of the Arduino IDE is faster and even more powerful! In addition to a more modern editor and a more responsive interface it features autocompletion, code navigation, and even a live debugger.

For more details, please refer to the Arduino IDE 2.0 documentation.

Nightly builds with the latest bugfixes are available through the section below.

SOURCE CODE

The Arduino IDE 2.0 is open source and its source code is hosted on GitHub.


Arduino with Chromebook

To program Arduino from a Chromebook, you can use the Arduino Web Editor on Arduino Cloud. The desktop version of the IDE is not available on ChromeOS.


MicroPython With Arduino Boards

To program your boards using MicroPython, visit the MicroPython with Arduino page. There you find download links and additional resources for getting started with MicroPython on your Arduino boards.


Arduino PLC IDE 1.0.3

Program using IEC 61131-3 languages and mix Arduino sketches through Arduino PLC IDE! Configure easily your pre-mapped resources and get quick no code fieldbus support, dive into your code analysis thanks to the wide set of debugging tools.

For more details, please refer to Arduino PLC IDE documentation.

DOWNLOAD OPTIONS

Both files are required

Version 1.0.4 coming soon


Legacy IDE (1.8.X)

Arduino IDE 1.8.19

The open-source Arduino Software (IDE) makes it easy to write code and upload it to the board. This software can be used with any Arduino board.

Refer to the Arduino IDE 1.x documentation for installation instructions.

SOURCE CODE

Active development of the Arduino software is hosted by GitHub. See the instructions for building the code. Latest release source code archives are available here. The archives are PGP-signed so they can be verified using this gpg key.


Terms of Service

By downloading the software from this page, you agree to the specified terms.

The Arduino software is provided to you "as is" and we make no express or implied warranties whatsoever with respect to its functionality, operability, or use, including, without limitation, any implied warranties of merchantability, fitness for a particular purpose, or infringement. We expressly disclaim any liability whatsoever for any direct, indirect, consequential, incidental or special damages, including, without limitation, lost revenues, lost profits, losses resulting from business interruption or loss of data, regardless of the form of action or legal theory under which the liability may be asserted, even if advised of the possibility or likelihood of such damages.

Để Arduino có thể hoạt động được, chúng ta cần lập trình điều khiển cho Arduino thực hiện một chức năng nào đó. Công cụ Arduino IDE hỗ trợ việc lập trình trở nên dễ dàng hơn.

1. Download Arduino IDE

Download Arduino IDE tại website chính thức của Arduino:

Hiện tại, phiên bản mới nhất (09/2018) của Arduino IDE là 1.8.6 với các phiên bản dành cho Windows, Linux, Mac OS X.

Double click file cài đặt Arduino IDE, chọn “I Agree”, sau đó, click Next và chọn đường dẫn cài đặt Arduino IDE, mặc định là C:\Program Files (x86)\Arduino. Chương trình cài đặt yêu cầu khoảng 500MB dung lượng ổ cứng còn trống.

Hướng dẫn cài đặt arduino 1.8.9

Chọn Install và đợi quá trình cài đặt hoàn tất.

Hướng dẫn cài đặt arduino 1.8.9

Double click biểu tượng Arduino trên màn hình Desktop. Chương trình Arduino IDE được mở lên.

Hướng dẫn cài đặt arduino 1.8.9

Hướng dẫn cài đặt arduino 1.8.9

3. Sử dụng Arduino IDE

Thanh công cụ của Arduino

Hướng dẫn cài đặt arduino 1.8.9

  • * Button đầu tiên: biên dịch code ra mã Hex để nạp vào Arduino
    • Button thứ hai: upload mã biên dịch vào Arduino
    • Button còn lại: lần lượt là New, Open, Save file code (.ino) Arduino.

Menu “File”

  • * Examples: chứa các ví dụ mẫu khi lập trình Arduino
    • Preferences: cấu hình cài đặt Arduino IDE

Menu “Tool”

  • * Board: chọn đúng loại board Arduino đang lập trình.
    • Port: chọn cổng kết nối Arduino với máy tính.

File mã nguồn (source code) của Arduino IDE có đuôi mở rộng là .ino. Để nhúng lệnh điều khiển vào Arduino thì cần biên dịch file .ino thành file .hex. File .hex chứa lệnh thực thi được biểu diễn dưới dạng hệ cơ số 16. Board mạch Arduino chỉ hiểu và chạy được những lệnh này.

Đổi đường dẫn biên dịch ra file Hex

– File Hex là file nạp vào Arduino để Arduino thực thi được

– Khi biên dịch thì file Hex sẽ nằm ở đường dẫn mặc định (thường trong Program Data trong phân vùng C). Để xem đường dẫn mặc định này, ta làm như sau:

Bước 1 – Chọn File->Preferences rồi chọn compilation ở phần “Show verbose output during”

Hướng dẫn cài đặt arduino 1.8.9

Bước 2 – Nhấn nút biên dịch file code đang mở và xem đường dẫn ở phần thông báo compile Arduino.

Hướng dẫn cài đặt arduino 1.8.9

Chúng ta có nhu cầu đổi đường dẫn file Hex để tiện việc quản lý và upload cho Arduino.

– Đổi đường dẫn file Hex, thực hiện các bước sau:

  • * Click File->Preferences->More preferences can be edited directly in the file (edit only when Arduino is not running), mặc định là C:\Users\ACER\AppData\Local\Arduino15. Tắt Arduino IDE, sau đó, delete file preferences.txt.
    • Mở đường dẫn cài đặt Arduino và vào thư mục lib, mặc định là C:\Program Files (x86)\Arduino\lib. Copy file preferences.txt ra ngoài Desktop.
    • Mở file này lên và thêm dòng lệnh build.path=[Đường dẫn]. Ví dụ, build.path=C:\\hex.
    • Copy file preferences.txt đè vào file preferences.txt trong thư mục lib. Tắt Arduino IDE và mở lại.

4. Bài tập

Cài đặt Arduino IDE, ghi nhớ đường dẫn cài đặt Arduino IDE.

Đổi đường dẫn compile file Hex trên Arduino IDE với đường dẫn mới là C:\\Hex

Build thử một chương trình (File->Examples->01.Basics->Blink) trong Arduino IDE để kiểm tra quá trình đổi đường dẫn mới.