Skip to content

Commit fc80b17

Browse files
committed
update example for OpenRB
Signed-off-by: Will Son <[email protected]>
1 parent 635380e commit fc80b17

File tree

34 files changed

+246
-214
lines changed

34 files changed

+246
-214
lines changed

examples/advanced/DEPRECATED_bulk_read_write_raw/DEPRECATED_bulk_read_write_raw.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,33 +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.
4848
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4949
//OpenRB does not require the DIR control pin.
5050
#define DXL_SERIAL Serial1
5151
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
5253
#else // Other boards when using DynamixelShield
5354
#define DXL_SERIAL Serial1
5455
#define DEBUG_SERIAL Serial
55-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5657
#endif
5758

5859
/* XelInfoForBulkReadParam_t

examples/advanced/DEPRECATED_sync_bulk_raw/DEPRECATED_sync_bulk_raw.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,33 +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.
4848
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4949
//OpenRB does not require the DIR control pin.
5050
#define DXL_SERIAL Serial1
5151
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
5253
#else // Other boards when using DynamixelShield
5354
#define DXL_SERIAL Serial1
5455
#define DEBUG_SERIAL Serial
55-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5657
#endif
5758

5859
/* ParamForSyncReadInst_t

examples/advanced/DEPRECATED_sync_read_write_raw/DEPRECATED_sync_read_write_raw.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -26,33 +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.
4848
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4949
//OpenRB does not require the DIR control pin.
5050
#define DXL_SERIAL Serial1
5151
#define DEBUG_SERIAL Serial
52+
const int DXL_DIR_PIN = -1;
5253
#else // Other boards when using DynamixelShield
5354
#define DXL_SERIAL Serial1
5455
#define DEBUG_SERIAL Serial
55-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
56+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5657
#endif
5758

5859
/* ParamForSyncReadInst_t

examples/advanced/add_custom_SerialPortHandler/add_custom_SerialPortHandler.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -22,33 +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.
4444
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4545
//OpenRB does not require the DIR control pin.
4646
#define DXL_SERIAL Serial1
4747
#define DEBUG_SERIAL Serial
48+
const int DXL_DIR_PIN = -1;
4849
#else // Other boards when using DynamixelShield
4950
#define DXL_SERIAL Serial1
5051
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
52+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5253
#endif
5354

5455

examples/advanced/bulk_read_write_raw/bulk_read_write_raw.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -22,33 +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.
4444
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4545
//OpenRB does not require the DIR control pin.
4646
#define DXL_SERIAL Serial1
4747
#define DEBUG_SERIAL Serial
48+
const int DXL_DIR_PIN = -1;
4849
#else // Other boards when using DynamixelShield
4950
#define DXL_SERIAL Serial1
5051
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
52+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5253
#endif
5354

5455

examples/advanced/fast_sync_read/fast_sync_read.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -24,33 +24,34 @@
2424
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
2525
#define DXL_SERIAL Serial
2626
#define DEBUG_SERIAL soft_serial
27-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
27+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
2828
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
2929
#define DXL_SERIAL Serial
3030
#define DEBUG_SERIAL SerialUSB
31-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
31+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3232
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
3333
#define DXL_SERIAL Serial1
3434
#define DEBUG_SERIAL SerialUSB
35-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
35+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
3636
#elif defined(ARDUINO_OpenCM904) // When using official ROBOTIS board with DXL circuit.
3737
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
3838
#define DEBUG_SERIAL Serial
39-
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)
39+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
4040
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
4141
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
4242
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
4343
#define DXL_SERIAL Serial3
4444
#define DEBUG_SERIAL Serial
45-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
45+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
4646
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4747
//OpenRB does not require the DIR control pin.
4848
#define DXL_SERIAL Serial1
4949
#define DEBUG_SERIAL Serial
50+
const int DXL_DIR_PIN = -1;
5051
#else // Other boards when using DynamixelShield
5152
#define DXL_SERIAL Serial1
5253
#define DEBUG_SERIAL Serial
53-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
54+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5455
#endif
5556
#define DXL_MOVING_STATUS_THRESHOLD 10
5657

examples/advanced/operating_mode_advanced/operating_mode_advanced.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -22,33 +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.
4444
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
4545
//OpenRB does not require the DIR control pin.
4646
#define DXL_SERIAL Serial1
4747
#define DEBUG_SERIAL Serial
48+
const int DXL_DIR_PIN = -1;
4849
#else // Other boards when using DynamixelShield
4950
#define DXL_SERIAL Serial1
5051
#define DEBUG_SERIAL Serial
51-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
52+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
5253
#endif
5354

5455

examples/advanced/read_write_ControlTableItem/read_write_ControlTableItem.ino

+7-6
Original file line numberDiff line numberDiff line change
@@ -121,33 +121,34 @@
121121
SoftwareSerial soft_serial(7, 8); // DYNAMIXELShield UART RX/TX
122122
#define DXL_SERIAL Serial
123123
#define DEBUG_SERIAL soft_serial
124-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
124+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
125125
#elif defined(ARDUINO_SAM_DUE) // When using DynamixelShield
126126
#define DXL_SERIAL Serial
127127
#define DEBUG_SERIAL SerialUSB
128-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
128+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
129129
#elif defined(ARDUINO_SAM_ZERO) // When using DynamixelShield
130130
#define DXL_SERIAL Serial1
131131
#define DEBUG_SERIAL SerialUSB
132-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
132+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
133133
#elif defined(ARDUINO_OpenCM904) // When using official ROBOTIS board with DXL circuit.
134134
#define DXL_SERIAL Serial3 //OpenCM9.04 EXP Board's DXL port Serial. (Serial1 for the DXL port on the OpenCM 9.04 board)
135135
#define DEBUG_SERIAL Serial
136-
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)
136+
const int DXL_DIR_PIN = 22; //OpenCM9.04 EXP Board's DIR PIN. (28 for the DXL port on the OpenCM 9.04 board)
137137
#elif defined(ARDUINO_OpenCR) // When using official ROBOTIS board with DXL circuit.
138138
// For OpenCR, there is a DXL Power Enable pin, so you must initialize and control it.
139139
// Reference link : https://github.com/ROBOTIS-GIT/OpenCR/blob/master/arduino/opencr_arduino/opencr/libraries/DynamixelSDK/src/dynamixel_sdk/port_handler_arduino.cpp#L78
140140
#define DXL_SERIAL Serial3
141141
#define DEBUG_SERIAL Serial
142-
const uint8_t DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
142+
const int DXL_DIR_PIN = 84; // OpenCR Board's DIR PIN.
143143
#elif defined(ARDUINO_OpenRB) // When using OpenRB-150
144144
//OpenRB does not require the DIR control pin.
145145
#define DXL_SERIAL Serial1
146146
#define DEBUG_SERIAL Serial
147+
const int DXL_DIR_PIN = -1;
147148
#else // Other boards when using DynamixelShield
148149
#define DXL_SERIAL Serial1
149150
#define DEBUG_SERIAL Serial
150-
const uint8_t DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
151+
const int DXL_DIR_PIN = 2; // DYNAMIXEL Shield DIR PIN
151152
#endif
152153

153154

0 commit comments

Comments
 (0)