Skip to content

Commit d83edcc

Browse files
committed
prework for release
Signed-off-by: Will Son <[email protected]>
1 parent de5a196 commit d83edcc

File tree

4 files changed

+32
-22
lines changed

4 files changed

+32
-22
lines changed

README.md

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
# Dynamixel2Arduino [![Build Status](https://travis-ci.org/ROBOTIS-GIT/Dynamixel2Arduino.svg?branch=master)](https://travis-ci.org/ROBOTIS-GIT/Dynamixel2Arduino/branches)
1+
# DYNAMIXEL2Arduino [![Build Status](https://github.com/ROBOTIS-GIT/Dynamixel2Arduino/workflows/dynamixel2arduino_ci/badge.svg)](https://github.com/ROBOTIS-GIT/Dynamixel2Arduino)
22

3-
## Serial and Direction Pin definitions by board
4-
- The examples defines GPIO pins based on the use with DYNAMIXEL Shields.
3+
## Serial and Direction Pin definitions of ROBOTIS controllers
54
- When running DYNAMIXEL without DYNAMIXEL Shields on OpenCM9.04, OpenCR or custom boards, you might need to change the Serial and DYNAMIXEL Direction Pin.
65
- We provide the information below to make it easier to define Serial and Direction pins for specific hardware.
76

87
|Board Name|Serial|Direction Pin|Note|
98
|:-:|:-:|:-:|:-:|
10-
|OpenCM9.04|Serial1|28|because of the OpenCM 9.04 driver code, you must call Serial1.setDxlMode(true); before dxl.begin();.|
9+
|OpenCM9.04|Serial1|28|Uploading Arduino Sketch will erase the factory firmware. The firmware can be recovered with DYNAMIXEL Wizard 2.0|
1110
|OpenCM485EXP|Serial3|22||
12-
|OpenCR|Serial3|84|For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it. ([Reference link](https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78))|
11+
|OpenCR|Serial3|84|OpenCR has an FET switch to control power supply to DYNAMIXEL. ([Reference link](https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78))|
12+
|OpenRB-150|Serial1|(-1)Automatic|-|
1313

1414

1515
## How to add new DYNAMIXEL model.
@@ -19,6 +19,3 @@
1919
## How to create custom PortHandler Class
2020
- Please refer to [port_handler.h](https://github.com/ROBOTIS-GIT/Dynamixel2Arduino/blob/master/src/utility/port_handler.h)
2121
- Create a new class by inheriting PortHandler as public. (Like SerialPortHandler and USBSerialPortHandler)
22-
23-
## TODO
24-
- Separation of protocol codes (protocol, packet handler)

examples/advanced/indirect_address/indirect_address.ino

+12-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2021 ROBOTIS CO., LTD.
1+
// Copyright 2022 ROBOTIS CO., LTD.
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -30,29 +30,34 @@
3030
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
3131
#define DXL_SERIAL Serial
3232
#define DEBUG_SERIAL soft_serial
33-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
33+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3434
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
3535
#define DXL_SERIAL Serial
3636
#define DEBUG_SERIAL SerialUSB
37-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
37+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3838
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
3939
#define DXL_SERIAL Serial1
4040
#define DEBUG_SERIAL SerialUSB
41-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
41+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
4242
#elif defined(ARDUINO_OpenCM904) // When using official ROBOTIS board with DXL circuit.
4343
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
4444
#define DEBUG_SERIAL Serial
45-
const uint8_t DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
45+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
4646
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
4747
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4848
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4949
#define DXL_SERIAL Serial3
5050
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
51+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
52+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
53+
//OpenRB does not require the DIR control pin.
54+
#define DXL_SERIAL Serial1
55+
#define DEBUG_SERIAL Serial
56+
const int DXL_DIR_PIN = -1;
5257
#else // Other boards when using DynamixelShield
5358
#define DXL_SERIAL Serial1
5459
#define DEBUG_SERIAL Serial
55-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
60+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5661
#endif
5762

5863

install.sh

+14-6
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ fi
1010
# this will be eval'd in the functions below because arrays can't be exported
1111
# For creating a new main platform, please refer to https://arduino.github.io/arduino-cli/latest/platform-specification/#hardware-folders-structure
1212
# and https://arduino.github.io/arduino-cli/latest/platform-specification/#boardstxt
13-
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [portenta]="arduino:mbed_portenta:envie_m7")'
13+
export MAIN_PLATFORMS='declare -A main_platforms=([uno]="arduino:avr:uno" [mega2560]="arduino:avr:mega:cpu=atmega2560" [leonardo]="arduino:avr:leonardo" [due]="arduino:sam:arduino_due_x" [zero]="arduino:samd:arduino_zero_native" [mzero]="arduino:samd:mzero_bl" [mzeropro]="arduino:samd:mzero_pro_bl" [mkrzero]="arduino:samd:mkrzero" [mkr1000]="arduino:samd:mkr1000" [mkrwifi1010]="arduino:samd:mkrwifi1010" [opencr]="OpenCR:OpenCR:OpenCR" [openrb-150]="OpenRB-150:samd:OpenRB-150" [portenta]="arduino:mbed_portenta:envie_m7")'
1414

1515
# make display available for arduino CLI
1616
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_1.pid --make-pidfile --background --exec /usr/bin/Xvfb -- :1 -ac -screen 0 1280x1024x16
@@ -38,14 +38,18 @@ sudo apt-get update
3838
sudo apt-get install libc6:i386
3939

4040
echo -n "ADD PACKAGE INDEX: "
41-
DEPENDENCY_OUTPUT=$(arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json,https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCM9.04/master/arduino/opencm_release/package_opencm9.04_index.json,https://github.com/espressif/arduino-esp32/releases/download/1.0.1/package_esp32_index.json" --save-prefs 2>&1)
41+
DEPENDENCY_OUTPUT=$(arduino --pref "boardsmanager.additional.urls=https://github.com/espressif/arduino-esp32/releases/download/1.0.1/package_esp32_index.json" --save-prefs 2>&1)
4242
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
4343

4444
# install other board packages
45-
echo -n "ADD OpenCR PACKAGE INDEX: "
46-
DEPENDENCY_OUTPUT=$(arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json" --save-prefs 2>&1)
45+
echo -n "ADD OpenRB-150 PACKAGE INDEX: "
46+
DEPENDENCY_OUTPUT=$(arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/ROBOTIS-GIT/OpenRB-150/master/package_openrb_index.json" --save-prefs 2>&1)
4747
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
4848

49+
# echo -n "ADD OpenCR PACKAGE INDEX: "
50+
# DEPENDENCY_OUTPUT=$(arduino --pref "boardsmanager.additional.urls=https://raw.githubusercontent.com/ROBOTIS-GIT/OpenCR/master/arduino/opencr_release/package_opencr_index.json" --save-prefs 2>&1)
51+
# if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
52+
4953
echo -n "INSTALL DUE(sam): "
5054
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:sam 2>&1)
5155
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
@@ -58,8 +62,12 @@ echo -n "INSTALL Portenta H7: "
5862
DEPENDENCY_OUTPUT=$(arduino --install-boards arduino:mbed_portenta 2>&1)
5963
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
6064

61-
echo -n "INSTALL OpenCR: "
62-
DEPENDENCY_OUTPUT=$(arduino --install-boards OpenCR:OpenCR 2>&1)
65+
# echo -n "INSTALL OpenCR: "
66+
# DEPENDENCY_OUTPUT=$(arduino --install-boards OpenCR:OpenCR 2>&1)
67+
# if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
68+
69+
echo -n "INSTALL OpenRB-150: "
70+
DEPENDENCY_OUTPUT=$(arduino --install-boards OpenRB-150:samd 2>&1)
6371
if [ $? -ne 0 ]; then echo -e "\xe2\x9c\x96"; else echo -e "\xe2\x9c\x93"; fi
6472

6573
# install random lib so the arduino IDE grabs a new library index

library.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Dynamixel2Arduino
2-
version=0.5.3
2+
version=0.6.0
33
author=ROBOTIS
44
license=Apache-2.0
55
maintainer=Will Son([email protected])

0 commit comments

Comments
 (0)