Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions examples/advanced/can2dynamixel/can2dynamixel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions examples/advanced/pid_tuning/pid_tuning.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
3 changes: 2 additions & 1 deletion examples/advanced/rc_pwm2dynamixel/rc_pwm2dynamixel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -184,4 +186,4 @@ void loop() {
}

delay(2000);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
4 changes: 3 additions & 1 deletion examples/basic/baudrate/baudrate.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,4 +79,4 @@ void setup() {

void loop() {
// put your main code here, to run repeatedly:
}
}
2 changes: 2 additions & 0 deletions examples/basic/current_mode/current_mode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion examples/basic/id/id.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -90,4 +92,4 @@ void setup() {

void loop() {
// put your main code here, to run repeatedly:
}
}
2 changes: 2 additions & 0 deletions examples/basic/led/led.ino
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <DynamixelShield.h>

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;
Expand Down
2 changes: 2 additions & 0 deletions examples/basic/operating_mode/operating_mode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion examples/basic/ping/ping.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -62,4 +64,4 @@ void loop() {
DEBUG_SERIAL.println("ping failed!");
}
delay(500);
}
}
2 changes: 2 additions & 0 deletions examples/basic/position_mode/position_mode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions examples/basic/pwm_mode/pwm_mode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 2 additions & 0 deletions examples/basic/torque/torque.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <DynamixelShield.h>

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;
Expand Down
2 changes: 2 additions & 0 deletions examples/basic/velocity_mode/velocity_mode.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 3 additions & 1 deletion examples/dynamixel_protocol/factory_reset/factory_reset.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -101,4 +103,4 @@ void loop() {
}

delay(1000);
}
}
4 changes: 3 additions & 1 deletion examples/dynamixel_protocol/ping/ping.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -78,4 +80,4 @@ void setup() {

void loop() {
// put your main code here, to run repeatedly:
}
}
4 changes: 3 additions & 1 deletion examples/dynamixel_protocol/reboot/reboot.ino
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -72,4 +74,4 @@ void loop() {
}

delay(1000);
}
}