RoArm-M2-S Secondary Development Tool Usage

From Waveshare Wiki
Jump to: navigation, search

RoArm-M2-S Secondary Development Tool Usage

This tutorial introduces the installation and usage of secondary development tools, explaining how to upload modified demos to RoArm-M2-S. Users can perform secondary development on the open-source robotic arm demo. The development tool introduced here is the Arduino IDE. The following outlines the installation and usage of the environment dependencies, such as libraries, for the robotic arm in the Arduino IDE.

What's Arduino IDE

Arduino IDE (Integrated Development Environment), a development platform based on open-source code, features its own language and development environment. Due to the extensive libraries provided by the Arduino IDE, complex components such as displays and sensors, as well as software platforms, are easy to use.

How To Install

1. Download Arduino IDE

Go to Arduino website to download the latest version. The official IDE supports downloads for different operating systems, so choose the one that matches your operating system. Here, we're downloading for Windows. If it's already installed, skip to the second step. The installation process is straightforward; simply keep clicking "Next" until completed.

ArduinoIDE1.png

Note: During the installation process, you may be prompted to install drivers. Simply continue clicking "Install" until the process is complete.

Install Development Environment

The main control module of the drive board on the robotic arm is ESP32, so we need to install the corresponding development board support for ESP32 in the Arduino IDE development environment. The steps are as follows:
1. Open Arduino IDE, click on "File" → "Preferences".

ESP32-C6-DEV-KIT-N8-Arduino03.png

2. Add the following link to the Additional Board Manager URLs, then click "OK" to save the settings.

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

ESP32-C6-DEV-KIT-N8-Arduino4.png

Note: If you need to add multiple development board URLs, you don't need to delete the URL for ESP32 development board support. You can directly add other URLs on another line. By default, URLs are separated by commas on different lines.
For example: If you need to add the URL on the ESP8266 development board, simply add the additional URLs on separate lines, and it will display 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 version 2.0.11, which matches the version required for the RoArm-M2-S open-source demo development board ESP32.


M2ESP326.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 on the figure to libraries file folder.

M2ESP327.png

Upload Demo

1. Download RoArm-M2-S_example, unzip it and double-click RoArm-M2_example.ino. Note that all files in this directory should be placed within the same folder.

M2 demo.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 demo 1.png


3. Connect the drive board on the RoArm-M2-S robotic arm to your computer using a USB cable (ensure it's connected to the left USB port). Then, click on "Tools" → "Port" and select the newly appeared COM port (in my case, it's COM29).

M2 dem 2.png


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

M2 demo 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 demo 4.png


6. Once all settings are configured, click "Upload" to upload the program to the drive board of the robotic arm.

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.