Quick Start for Dynamixel Pro v1.00b
ii. Reading the temperature and the current position using Indirect Address
-
Implement Indirect Address to obtain read outputsl.
-
Read the Present Position and Present Temperature by using Indirect Address.
-
The program's entire source code is shown below.
main.cpp
#include
<stdio.h>
#include
<conio.h>
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
#define
P_OPERATING_MODE
#define
P_INDIRECT_ADDRESS_0
Table
#define
P_INDIRECT_ADDRESS_1
Table
#define
P_INDIRECT_ADDRESS_2
Table
#define
P_INDIRECT_ADDRESS_3
Table
#define
P_INDIRECT_ADDRESS_4
Table
#define
P_TORQUE_ENABLE
#define
P_PRESENT_POSITION
#define
P_PRESENT_TEMPERATURE 625
Table
#define
P_INDIRECT_DATA_0
Control Table
#define
ID
// Print error bit of status packet
void PrintErrorCode(int
{
if(ErrorCode & ERRBIT_VOLTAGE)
printf("Input voltage
if(ErrorCode & ERRBIT_ANGLE)
printf("Angle limit
if(ErrorCode & ERRBIT_OVERHEAT)
printf("Overheat
if(ErrorCode & ERRBIT_RANGE)
printf("Out of range
17
3
11
49
51
53
55
57
562
611
1
ErrorCode)
error!\n");
error!\n");
error!\n");
error!\n");
//Comport Number of USB2DXL
//Baudrate Number of Dynamixel PRO
//Address of Operating Mode in Control Table
//Address of 1st Indirect Address in Control
//Address of 2nd Indirect Address in Control
//Address of 3rd Indirect Address in Control
//Address of 4th Indirect Address in Control
//Address of 5th Indirect Address in Control
//Address of Torque Enable in Control Table
//Address of Present Position in Control Table
//Address of Present Temperature in Control
634
//Address of Goal Indirect Data in
//ID of Dynamixel PRO you use
Page 93 / 139
Need help?
Do you have a question about the Dynamixel Pro and is the answer not in the manual?
Questions and answers