From 9fd4098840305750467e930f83d136ee519ab5d6 Mon Sep 17 00:00:00 2001 From: Jonathon Date: Mon, 12 Jun 2023 17:32:40 -0700 Subject: [PATCH] Added comment to provide information on AX MX default use of protocol 1 communications. --- examples/advanced/can2dynamixel/can2dynamixel.ino | 2 ++ examples/advanced/pid_tuning/pid_tuning.ino | 2 ++ examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino | 3 ++- .../read_write_ControlTableItem.ino | 4 +++- .../sync_read_write_position/sync_read_write_position.ino | 2 ++ .../sync_read_write_velocity/sync_read_write_velocity.ino | 2 ++ examples/basic/baudrate/baudrate.ino | 4 +++- examples/basic/current_mode/current_mode.ino | 2 ++ .../basic/current_position_mode/current_position_mode.ino | 2 ++ examples/basic/id/id.ino | 4 +++- examples/basic/led/led.ino | 2 ++ examples/basic/operating_mode/operating_mode.ino | 2 ++ examples/basic/ping/ping.ino | 4 +++- examples/basic/position_mode/position_mode.ino | 2 ++ .../profile_velocity_acceleration.ino | 2 ++ examples/basic/pwm_mode/pwm_mode.ino | 2 ++ examples/basic/torque/torque.ino | 2 ++ examples/basic/velocity_mode/velocity_mode.ino | 2 ++ examples/dynamixel_protocol/factory_reset/factory_reset.ino | 4 +++- examples/dynamixel_protocol/ping/ping.ino | 4 +++- examples/dynamixel_protocol/reboot/reboot.ino | 4 +++- 21 files changed, 49 insertions(+), 8 deletions(-) diff --git a/examples/advanced/can2dynamixel/can2dynamixel.ino b/examples/advanced/can2dynamixel/can2dynamixel.ino index 5e0795d..38bd85f 100644 --- a/examples/advanced/can2dynamixel/can2dynamixel.ino +++ b/examples/advanced/can2dynamixel/can2dynamixel.ino @@ -95,6 +95,8 @@ const uint8_t RX_BUFFER_SIZE = 30; const CanBitRate CAN_BUADRATE = CanBitRate::BR_1000kBPS_16MHZ; // Define the DYNAMIXEL Protocol version to use. +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; // Define the Baud Rate of DYNAMIXEL to use. Recommend not to exceed 1Mbps. const uint32_t DXL_BUADRATE = 1000000; diff --git a/examples/advanced/pid_tuning/pid_tuning.ino b/examples/advanced/pid_tuning/pid_tuning.ino index 9a82b34..02f84ce 100644 --- a/examples/advanced/pid_tuning/pid_tuning.ino +++ b/examples/advanced/pid_tuning/pid_tuning.ino @@ -39,6 +39,8 @@ const uint8_t DXL_ID = 1; const uint32_t DXL_BAUDRATE = 57600; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; int32_t goal_position[2] = {1200, 1600}; diff --git a/examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino b/examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino index 2e6ee75..4600833 100644 --- a/examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino +++ b/examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino @@ -40,7 +40,8 @@ DynamixelShield dxl; // Number of PWM Channels const uint8_t PWM_CHANNEL_SIZE = 8; -// DYNAMIXEL Protocol Version [1.0 / 2.0] +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; // DYNAMIXEL Baudrate const uint32_t DXL_BUADRATE = 1000000; diff --git a/examples/advanced/read_write_ControlTableItem/read_write_ControlTableItem.ino b/examples/advanced/read_write_ControlTableItem/read_write_ControlTableItem.ino index d6d2bfc..d2e2bf4 100644 --- a/examples/advanced/read_write_ControlTableItem/read_write_ControlTableItem.ino +++ b/examples/advanced/read_write_ControlTableItem/read_write_ControlTableItem.ino @@ -135,6 +135,8 @@ using namespace ControlTableItem; void setup() { // put your setup code here, to run once: DEBUG_SERIAL.begin(115200); +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; dxl.setPortProtocolVersion(2.0); dxl.begin(57600); dxl.scan(); @@ -184,4 +186,4 @@ void loop() { } delay(2000); -} \ No newline at end of file +} diff --git a/examples/advanced/sync_read_write_position/sync_read_write_position.ino b/examples/advanced/sync_read_write_position/sync_read_write_position.ino index ceb99bf..3d54e4c 100644 --- a/examples/advanced/sync_read_write_position/sync_read_write_position.ino +++ b/examples/advanced/sync_read_write_position/sync_read_write_position.ino @@ -72,6 +72,8 @@ */ const uint8_t BROADCAST_ID = 254; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DYNAMIXEL_PROTOCOL_VERSION = 1.0; const float DYNAMIXEL_PROTOCOL_VERSION = 2.0; const uint8_t DXL_ID_CNT = 2; const uint8_t DXL_ID_LIST[DXL_ID_CNT] = {1, 2}; diff --git a/examples/advanced/sync_read_write_velocity/sync_read_write_velocity.ino b/examples/advanced/sync_read_write_velocity/sync_read_write_velocity.ino index de9199a..27dcfe0 100755 --- a/examples/advanced/sync_read_write_velocity/sync_read_write_velocity.ino +++ b/examples/advanced/sync_read_write_velocity/sync_read_write_velocity.ino @@ -73,6 +73,8 @@ */ const uint8_t BROADCAST_ID = 254; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DYNAMIXEL_PROTOCOL_VERSION = 1.0; const float DYNAMIXEL_PROTOCOL_VERSION = 2.0; const uint8_t DXL_ID_CNT = 2; const uint8_t DXL_ID_LIST[DXL_ID_CNT] = {1, 2}; diff --git a/examples/basic/baudrate/baudrate.ino b/examples/basic/baudrate/baudrate.ino index 136f116..9c65f35 100644 --- a/examples/basic/baudrate/baudrate.ino +++ b/examples/basic/baudrate/baudrate.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; uint32_t BAUDRATE = 57600; uint32_t NEW_BAUDRATE = 1000000; //1Mbsp @@ -77,4 +79,4 @@ void setup() { void loop() { // put your main code here, to run repeatedly: -} \ No newline at end of file +} diff --git a/examples/basic/current_mode/current_mode.ino b/examples/basic/current_mode/current_mode.ino index d2226e0..e14c9f0 100644 --- a/examples/basic/current_mode/current_mode.ino +++ b/examples/basic/current_mode/current_mode.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/current_position_mode/current_position_mode.ino b/examples/basic/current_position_mode/current_position_mode.ino index 5eacc0d..e0321aa 100644 --- a/examples/basic/current_position_mode/current_position_mode.ino +++ b/examples/basic/current_position_mode/current_position_mode.ino @@ -31,6 +31,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/id/id.ino b/examples/basic/id/id.ino index af47108..49f342b 100644 --- a/examples/basic/id/id.ino +++ b/examples/basic/id/id.ino @@ -28,6 +28,8 @@ const uint8_t DEFAULT_DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; @@ -90,4 +92,4 @@ void setup() { void loop() { // put your main code here, to run repeatedly: -} \ No newline at end of file +} diff --git a/examples/basic/led/led.ino b/examples/basic/led/led.ino index 42e9ef4..ee7763d 100644 --- a/examples/basic/led/led.ino +++ b/examples/basic/led/led.ino @@ -17,6 +17,8 @@ #include const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/operating_mode/operating_mode.ino b/examples/basic/operating_mode/operating_mode.ino index 0825b40..ffec467 100644 --- a/examples/basic/operating_mode/operating_mode.ino +++ b/examples/basic/operating_mode/operating_mode.ino @@ -37,6 +37,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/ping/ping.ino b/examples/basic/ping/ping.ino index bd39be2..5b47a15 100644 --- a/examples/basic/ping/ping.ino +++ b/examples/basic/ping/ping.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; @@ -62,4 +64,4 @@ void loop() { DEBUG_SERIAL.println("ping failed!"); } delay(500); -} \ No newline at end of file +} diff --git a/examples/basic/position_mode/position_mode.ino b/examples/basic/position_mode/position_mode.ino index 148fdb8..cb8da8b 100644 --- a/examples/basic/position_mode/position_mode.ino +++ b/examples/basic/position_mode/position_mode.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/profile_velocity_acceleration/profile_velocity_acceleration.ino b/examples/basic/profile_velocity_acceleration/profile_velocity_acceleration.ino index b5d9d8e..b739b84 100644 --- a/examples/basic/profile_velocity_acceleration/profile_velocity_acceleration.ino +++ b/examples/basic/profile_velocity_acceleration/profile_velocity_acceleration.ino @@ -32,6 +32,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/pwm_mode/pwm_mode.ino b/examples/basic/pwm_mode/pwm_mode.ino index f14681f..30da018 100644 --- a/examples/basic/pwm_mode/pwm_mode.ino +++ b/examples/basic/pwm_mode/pwm_mode.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/torque/torque.ino b/examples/basic/torque/torque.ino index bd35567..fd1d8af 100644 --- a/examples/basic/torque/torque.ino +++ b/examples/basic/torque/torque.ino @@ -21,6 +21,8 @@ #include const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/basic/velocity_mode/velocity_mode.ino b/examples/basic/velocity_mode/velocity_mode.ino index 4e9a7c5..cc91c23 100644 --- a/examples/basic/velocity_mode/velocity_mode.ino +++ b/examples/basic/velocity_mode/velocity_mode.ino @@ -27,6 +27,8 @@ #endif const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; diff --git a/examples/dynamixel_protocol/factory_reset/factory_reset.ino b/examples/dynamixel_protocol/factory_reset/factory_reset.ino index a1d83b2..951d449 100644 --- a/examples/dynamixel_protocol/factory_reset/factory_reset.ino +++ b/examples/dynamixel_protocol/factory_reset/factory_reset.ino @@ -28,6 +28,8 @@ #define TIMEOUT 10 //default communication timeout 10ms const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; bool ret = false; @@ -101,4 +103,4 @@ void loop() { } delay(1000); -} \ No newline at end of file +} diff --git a/examples/dynamixel_protocol/ping/ping.ino b/examples/dynamixel_protocol/ping/ping.ino index d55412d..6171816 100644 --- a/examples/dynamixel_protocol/ping/ping.ino +++ b/examples/dynamixel_protocol/ping/ping.ino @@ -38,6 +38,8 @@ uint8_t ret = 0; uint8_t recv_count = 0; const uint8_t DXL_ID = BROADCAST_ID; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; DynamixelShield dxl; @@ -78,4 +80,4 @@ void setup() { void loop() { // put your main code here, to run repeatedly: -} \ No newline at end of file +} diff --git a/examples/dynamixel_protocol/reboot/reboot.ino b/examples/dynamixel_protocol/reboot/reboot.ino index 89ee353..645ad6f 100644 --- a/examples/dynamixel_protocol/reboot/reboot.ino +++ b/examples/dynamixel_protocol/reboot/reboot.ino @@ -28,6 +28,8 @@ #define TIMEOUT 10 //default communication timeout 10ms const uint8_t DXL_ID = 1; +// MX and AX servos use DYNAMIXEL Protocol 1.0 by default. +// to use MX and AX servos with this example, change the following line to: const float DXL_PROTOCOL_VERSION = 1.0; const float DXL_PROTOCOL_VERSION = 2.0; uint8_t option = 0; @@ -72,4 +74,4 @@ void loop() { } delay(1000); -} \ No newline at end of file +}