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;
int
current_length = 2, position_length = 4, temperature_length = 1;
unsigned char
param[0] = ID_1;
param[1] = DXL_LOBYTE(P_PRESENT_CURRENT);
param[2] = DXL_HIBYTE(P_PRESENT_CURRENT);
param[3] = DXL_LOBYTE(current_length);
param[4] = DXL_HIBYTE(current_length);
param[5] = ID_2;
param[6] = DXL_LOBYTE(P_PRESENT_POSITION);
param[7] = DXL_HIBYTE(P_PRESENT_POSITION);
param[8] = DXL_LOBYTE(position_length);
param[9] = DXL_HIBYTE(position_length);
param[10] = ID_3;
param[11] = DXL_LOBYTE(P_PRESENT_TEMPERATURE);
param[12] = DXL_HIBYTE(P_PRESENT_TEMPERATURE);
param[13] = DXL_LOBYTE(temperature_length);
param[14] = DXL_HIBYTE(temperature_length);
BulkData bd[256];
BulkData *pbd[256];
for(unsigned int
pbd[i] = &bd[i];
dxl_bulk_read(Port, param, 15, pbd);
int
present_current;
int
present_position;
int
present_temperature;
dxl_get_bulk_word( pbd, ID_1, P_PRESENT_CURRENT,
&present_current);
dxl_get_bulk_dword(pbd, ID_2, P_PRESENT_POSITION,
(unsigned*)&present_position);
USB2Dynamixel!\n");
"Failed to open USB2Dynamixel!\n"
"Press any key to terminate...\n"
0;
param[15];
i = 0 ; i <256 ; i++)
);
);
Page 107 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers