Quick Start for Dynamixel Pro v1.00b
while(true)
{
if(_kbhit())
unsigned char
dxl_read(Port, ID, P_PRESENT_POSITION, 8, data, &ErrorStatus);
int
present_position, present_velocity;
present_position = DXL_MAKEDWORD( DXL_MAKEWORD(data[0], data[1]),
DXL_MAKEWORD(data[2], data[3]) );
present_velocity = DXL_MAKEDWORD( DXL_MAKEWORD(data[4], data[5]),
DXL_MAKEWORD(data[6], data[7]) );
printf("\r");
printf("present position : %d, presen velocity :
present_velocity);
}
printf("\n");
//Close the port of USB2DXL
printf(
"Press any key to terminate...\n"
_getch();
//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
}
dxl_terminate(Port);
return
0;
}
break;
data[8];
);
"Failed to write!\n"
);
"Press any key to terminate...\n"
0;
%d", present_position,
);
);
Page 75 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers