Basic Functions Of Dynamixel Pro; Turning The Torque On/Off Of Dynamixel Pro - Robotis Dynamixel Pro Quick Start Manual

Table of Contents

Advertisement

Quick Start for Dynamixel Pro v1.00b

1.2.2 Basic functions of Dynamixel PRO.

i. Turning the torque On/Off of Dynamixel PRO.
-
As explained in 1.1, Dynamixel PRO's Control Table contains Torque Enable
function that controls the torque to be on/off. The address for Torque Enable
function is 562. Torque Enable is has 1 byte assigned.
-
Therefore, implement dxl_write_byte function (See 2.4.3)
-
The program's entire source is shown below.
main.cpp
#include
<stdio.h>
#include
<conio.h>
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
#define
P_TORQUE_ENABLE
#define
ID
int
main(void)
{
SerialPort sp = {0,0,0,0,0};
SerialPort *Port = &sp;
//Open the port of USB2DXL
if(dxl_initialize(Port, COM_PORT_NUM, BAUD_RATE_NUM) == COMM_RXSUCCESS )
printf("Succeed to open
else
{
printf(
printf(
_getch();
return
}
int
ErrorStatus;
int
Result;
//Torque ON
printf(
"Press any key to turn on the torque...\n"
_getch();
Result = dxl_write_byte(Port, ID, P_TORQUE_ENABLE, 1, &ErrorStatus);
//Torque OFF
printf(
"Press any key to turn off the torque...\n"
_getch();
Result = dxl_write_byte(Port, ID, P_TORQUE_ENABLE, 0, &ErrorStatus);
//Close the port of USB2DXL
17
1
562
1
//ID of Dynamixel PRO you use
USB2Dynamixel!\n");
"Failed to open USB2Dynamixel!\n"
"Press any key to terminate...\n"
0;
//Comport Number of USB2DXL
//Baudrate Number of Dynamixel PRO. 1 is 57600 bps
//Address of Torque Enable in Control Table
);
);
);
);
Page 43 / 139

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Dynamixel Pro and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents