Robotis Dynamixel Pro Quick Start Manual page 91

Table of Contents

Advertisement

Quick Start for Dynamixel Pro v1.00b
{
if(ErrorStatus != 0 )
else
}
//Torque On
printf(
"Torque On...\n"
Result = dxl_write_byte(Port, ID, P_TORQUE_ENABLE, 1, &ErrorStatus);
if( Result != COMM_RXSUCCESS )
{
printf(
printf(
_getch();
return
}
int
position, velocity, acceleration;
position = 100000;
velocity = 10000;
acceleration = 16;
//Make a tx data
unsigned char
data[0] = DXL_LOBYTE(DXL_LOWORD(position));
data[1] = DXL_HIBYTE(DXL_LOWORD(position));
data[2] = DXL_LOBYTE(DXL_HIWORD(position));
data[3] = DXL_HIBYTE(DXL_HIWORD(position));
data[4] = DXL_LOBYTE(DXL_LOWORD(velocity));
data[5] = DXL_HIBYTE(DXL_LOWORD(velocity));
data[6] = DXL_LOBYTE(DXL_HIWORD(velocity));
data[7] = DXL_HIBYTE(DXL_HIWORD(velocity));
data[8] = DXL_LOBYTE(DXL_LOWORD(acceleration));
data[9] = DXL_HIBYTE(DXL_LOWORD(acceleration));
data[10] = DXL_LOBYTE(DXL_HIWORD(acceleration));
data[11] = DXL_HIBYTE(DXL_HIWORD(acceleration));
//change the position value, moving speed, acceleration using indirect addr
printf(
"Press any key to change the position, speed, acceleration...\n"
_getch();
Result = dxl_write(Port, ID, P_INDIRECT_DATA_0, 12, data, &ErrorStatus);
if( Result != COMM_RXSUCCESS )
{
printf(
printf(
_getch();
return
}
PrintErrorCode(ErrorStatus);
printf("Succeed to set the indirect address for goal
);
"Failed to write!\n"
);
"Press any key to terminate...\n"
0;
data[12];
"Failed to write!\n"
);
"Press any key to terminate...\n"
0;
acceleration!\n");
);
);
);
Page 91 / 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

Table of Contents