Quick Start for Dynamixel Pro v1.00b
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
Result, ErrorStatus;
//Torque Off
printf(
"Torque Off...\n"
Result = dxl_write_byte(Port, ID, P_TORQUE_ENABLE, 0, &ErrorStatus);
if( Result != COMM_RXSUCCESS )
{
printf(
printf(
_getch();
return
}
//Set the Indirect Address for Goal Position
printf("Press any key to set the indirect address for goal
_getch();
Result = dxl_write_word(Port, ID, P_INDIRECT_ADDRESS_0, P_GOAL_POSITION,
&ErrorStatus);
Result = dxl_write_word(Port, ID, P_INDIRECT_ADDRESS_1, P_GOAL_POSITION+1,
&ErrorStatus);
Result = dxl_write_word(Port, ID, P_INDIRECT_ADDRESS_2, P_GOAL_POSITION+2,
&ErrorStatus);
Result = dxl_write_word(Port, ID, P_INDIRECT_ADDRESS_3, P_GOAL_POSITION+3,
&ErrorStatus);
if( Result != COMM_RXSUCCESS )
{
printf(
printf(
_getch();
return
}
else
{
if(ErrorStatus != 0 )
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;
);
);
);
position...\n");
);
Page 89 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers