Skip to content

Commit d61b7b6

Browse files
authored
Merge pull request #104 from ROBOTIS-GIT/develop
Release 0.6.0
2 parents 2b8b91f + afdade8 commit d61b7b6

File tree

48 files changed

+4270
-3178
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+4270
-3178
lines changed

.github/workflows/dynamixel2arduino_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
- name: Run Arduino CI Script
1717
run: |
1818
source <(curl -SLs https://raw.githubusercontent.com/ROBOTIS-GIT/Dynamixel2Arduino/master/install.sh) ${{github.ref}}
19-
build_platform opencr
19+
build_platform openrb-150
2020
build_platform uno
2121
build_platform mega2560
2222
build_platform mkrzero

README.md

Lines changed: 5 additions & 8 deletions
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/DEPRECATED_bulk_read_write_raw/DEPRECATED_bulk_read_write_raw.ino

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,34 @@
2626
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2727
#define DXL_SERIAL Serial
2828
#define DEBUG_SERIAL soft_serial
29-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
29+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3030
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
3131
#define DXL_SERIAL Serial
3232
#define DEBUG_SERIAL SerialUSB
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_ZERO) // When using DynamixelShield
3535
#define DXL_SERIAL Serial1
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_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3939
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
4040
#define DEBUG_SERIAL Serial
41-
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)
41+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
4242
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
4343
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4444
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4545
#define DXL_SERIAL Serial3
4646
#define DEBUG_SERIAL Serial
47-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
47+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
48+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
49+
//OpenRB does not require the DIR control pin.
50+
#define DXL_SERIAL Serial1
51+
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
4853
#else // Other boards when using DynamixelShield
4954
#define DXL_SERIAL Serial1
5055
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5257
#endif
5358

5459
/* XelInfoForBulkReadParam_t

examples/advanced/DEPRECATED_sync_bulk_raw/DEPRECATED_sync_bulk_raw.ino

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,34 @@
2626
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2727
#define DXL_SERIAL Serial
2828
#define DEBUG_SERIAL soft_serial
29-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
29+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3030
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
3131
#define DXL_SERIAL Serial
3232
#define DEBUG_SERIAL SerialUSB
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_ZERO) // When using DynamixelShield
3535
#define DXL_SERIAL Serial1
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_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3939
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
4040
#define DEBUG_SERIAL Serial
41-
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)
41+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
4242
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
4343
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4444
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4545
#define DXL_SERIAL Serial3
4646
#define DEBUG_SERIAL Serial
47-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
47+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
48+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
49+
//OpenRB does not require the DIR control pin.
50+
#define DXL_SERIAL Serial1
51+
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
4853
#else // Other boards when using DynamixelShield
4954
#define DXL_SERIAL Serial1
5055
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5257
#endif
5358

5459
/* ParamForSyncReadInst_t

examples/advanced/DEPRECATED_sync_read_write_raw/DEPRECATED_sync_read_write_raw.ino

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,29 +26,34 @@
2626
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2727
#define DXL_SERIAL Serial
2828
#define DEBUG_SERIAL soft_serial
29-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
29+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3030
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
3131
#define DXL_SERIAL Serial
3232
#define DEBUG_SERIAL SerialUSB
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_ZERO) // When using DynamixelShield
3535
#define DXL_SERIAL Serial1
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_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3939
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
4040
#define DEBUG_SERIAL Serial
41-
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)
41+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
4242
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
4343
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4444
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4545
#define DXL_SERIAL Serial3
4646
#define DEBUG_SERIAL Serial
47-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
47+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
48+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
49+
//OpenRB does not require the DIR control pin.
50+
#define DXL_SERIAL Serial1
51+
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
4853
#else // Other boards when using DynamixelShield
4954
#define DXL_SERIAL Serial1
5055
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5257
#endif
5358

5459
/* ParamForSyncReadInst_t

examples/advanced/add_custom_SerialPortHandler/add_custom_SerialPortHandler.ino

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,34 @@
2222
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2323
#define DXL_SERIAL Serial
2424
#define DEBUG_SERIAL soft_serial
25-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
25+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
2626
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
2727
#define DXL_SERIAL Serial
2828
#define DEBUG_SERIAL SerialUSB
29-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
29+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3030
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
3131
#define DXL_SERIAL Serial1
3232
#define DEBUG_SERIAL SerialUSB
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_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3535
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
3636
#define DEBUG_SERIAL Serial
37-
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)
37+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
3838
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
3939
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4040
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4141
#define DXL_SERIAL Serial3
4242
#define DEBUG_SERIAL Serial
43-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
43+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
44+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
45+
//OpenRB does not require the DIR control pin.
46+
#define DXL_SERIAL Serial1
47+
#define DEBUG_SERIAL Serial
48+
const int DXL_DIR_PIN = -1;
4449
#else // Other boards when using DynamixelShield
4550
#define DXL_SERIAL Serial1
4651
#define DEBUG_SERIAL Serial
47-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
52+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
4853
#endif
4954

5055

examples/advanced/bulk_read_write_raw/bulk_read_write_raw.ino

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,29 +22,34 @@
2222
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2323
#define DXL_SERIAL Serial
2424
#define DEBUG_SERIAL soft_serial
25-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
25+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
2626
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
2727
#define DXL_SERIAL Serial
2828
#define DEBUG_SERIAL SerialUSB
29-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
29+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3030
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
3131
#define DXL_SERIAL Serial1
3232
#define DEBUG_SERIAL SerialUSB
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_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3535
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
3636
#define DEBUG_SERIAL Serial
37-
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)
37+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
3838
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
3939
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4040
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4141
#define DXL_SERIAL Serial3
4242
#define DEBUG_SERIAL Serial
43-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
43+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
44+
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
45+
//OpenRB does not require the DIR control pin.
46+
#define DXL_SERIAL Serial1
47+
#define DEBUG_SERIAL Serial
48+
const int DXL_DIR_PIN = -1;
4449
#else // Other boards when using DynamixelShield
4550
#define DXL_SERIAL Serial1
4651
#define DEBUG_SERIAL Serial
47-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
52+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
4853
#endif
4954

5055

0 commit comments

Comments
 (0)