Robotis Dynamixel Pro Quick Start Manual page 57

Table of Contents

Advertisement

Quick Start for Dynamixel Pro v1.00b
{
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
Result, ErrorStatus;
//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
}
//change the position p gain
printf("Press any key to change the position p
_getch();
Result = dxl_write_word(Port, ID, P_POSITION_P_GAIN, 8, &ErrorStatus);
if( Result != COMM_RXSUCCESS )
{
printf(
printf(
_getch();
return
}
else
{
if(ErrorStatus != 0 )
}
//change the goal position value
printf("Press any key to change the goal
_getch();
Result = dxl_write_dword(Port, ID, P_GOAL_POSITION, 100000, &ErrorStatus);
if( Result != COMM_RXSUCCESS )
USB2Dynamixel!\n");
"Failed to open USB2Dynamixel!\n"
"Press any key to terminate...\n"
0;
);
"Failed to write!\n"
);
"Press any key to terminate...\n"
0;
"Failed to write!\n"
);
"Press any key to terminate...\n"
0;
PrintErrorCode(ErrorStatus);
);
);
);
gain\n");
);
position\n");
Page 57 / 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