HexArth Development Tool Usage

From Waveshare Wiki
Jump to: navigation, search

HexArth_Secondary Development Tool Usage

This tutorial introduces the installation and usage of secondary development tools and how to upload modified programs to HexArth, allowing users to perform secondary development on the open-source robot programs. The development tool introduced here is the Arduino IDE. The following sections explain the installation and usage of the required libraries and environment for the robot within the Arduino IDE.


What is Arduino IDE

Arduino IDE (Integrated Development Environment), is a development platform based on open-source code, with its own programming language and development environment. Since Arduino IDE provides a wide range of libraries, complex components (such as displays, sensors) and the software platform are easy to use.


Arduino IDE Installation

1. Install Arduino IDE

First, go to Arduino official website to download the installation package of the latest Arduino IDE version. The official IDE supports downloading for different operating systems, you can select according to your operating system. Here we have downloaded one for Windows, if you have installed it, you can skip to the second step. The process is simple and you just need to click Next during the installation

ArduinoIDE1.png

Notice: During the installation process, it will prompt you to install the driver, just click Install.


2. Set Language in Arduino IDE Interface

After the first installation, when you open the Arduino IDE, it will be in English. You can switch to other language in File --> Preferences, or continue using the English interface.

安装Arduino2.png

In the Language field, select the language you want to switch to, and click OK.

安装Arduino3.png


Install Development Environment

The main control module on the robot's driver board is ESP32, so we need to install the corresponding ESP32 board package in the Arduino IDE development environment. The steps are as follows:

1. Open the Arduino IDE and click "File" → "Preferences".

M2ESP321.png


2. Add the following link to the attached board manager URL, and then click OK to save the settings.

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

M2ESP322.png

Note: If you need to add multiple board URLs, you don't need to delete the URLs supported by the ESP32 board. You can directly add other URLs on a new line. By default, the URLs are separated by commas. For example, if you need to add the URL of the ESP8266 development board, add it to another line, which will be displayed as follows:

https://dl.espressif.com/dl/package_esp32_index.json,http://arduino.esp8266.com/stable/package_esp8266com_index.json

M2ESP323.pngM2ESP324.png


3. Click to download ESP32 development package and unzip. Input the following path on "my computer":

C:\Users\username\AppData\Local\Arduino15

The "username" needs to be changed according to your computer's username. Create a new folder named "packages" and copy the extracted folder of the ESP32 development package into the "packages" folder.

M2ESP325.png


You can see that the installed ESP32 development board version from "packages-esp32-hardware-esp32" is 3.0.7. The required board package version for HexArth's open-source program is ESP32 version 3.0.7.

Esp3.0.7.png


Install Dependency Library

Download libraries, unzip them, and open the default Arduino installation path: C:\Users\username\AppData\Local\Arduino15\libraries (please according to your actual path), and then copy the files in the figure to libraries file folder.

M2 libraries.png


Upload Demo

1. Download the HexArth Lower Computer Open-Source Demo. After extracting, double-click to open HexArth_example.ino. Note that all files in this directory should be placed within the same folder.

M2上传程序.png


2. Click on "Tools" → "Port" and take note of the COM port already listed on your computer. Do not click on this COM port. (At this moment, the displayed COM port on my computer is COM1; the COM ports may differ on different computers.)

M2上传程序1.png


3. Use a USB cable to connect the driver board on the HexArth robot to your computer (ensure it's connected to the left USB port). Then, click on "Tools" → "Port" and select the newly appeared COM port (here, the new COM is COM29).

M2上传程序2.png


4. In Arduino IDE, click on "Tool" → "DevBoard" → "ESP32" → "ESP32 Dev Module".

M2上传程序3.png


5. Click on "Tool", others as shown below: (For the Partition Scheme, it's recommended to use "Huge APP" and ensure that PSRAM is set to "Enabled.")

M2上传程序4.png


6. After all settings are complete, click "Upload" to upload the program to the robot's driver board.

M2上传程序5.png


  • If you encounter problems during the upload process and need to reinstall or change the Arduino IDE version, it's important to uninstall Arduino IDE completely. After uninstalling the software, you'll need to manually delete all contents within the folder "C:\Users\username\AppData\Local\Arduino15" (some hidden files may need to be displayed first). Then, proceed to download and reinstall the Arduino IDE.