Inialize And Terminate The Connnection With Usb-To-Dynamixel Dongle - Robotis Dynamixel Pro Quick Start Manual

Table of Contents

Advertisement

Quick Start for Dynamixel Pro v1.00b
ii. Inialize and terminate the connnection with USB-to-Dynamixel dongle
-
First, open a .cpp file and copy the code below. The COM_PORT_NUM and
BAUD_RATE_NUM values need to match the proper USB-to-Dynamixel dongle in
use.
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
-
The relationship between the baud rate number and the baud rate is indicated
below.
Baudrate
Number
0
1
2
3
4
5
6
7
8
-
Declare the 'SerialPort' type variable and then initialize all the values to zero.
-
Declare the 'SerialPort' pointer type variable, then initialize it with addresss of the
predefined variable. Please refer to the source code shown below.
SerialPort sp = {0,0,0,0,0};
SerialPort *Port = &sp;
-
Next, implement functions, dxl_initialize and dxl_terminate, to
connect and disconnect to USB-to-Dynamixel dongle.
-
The program's entire source is shown below.
main.cpp
#include
<stdio.h>
#include
<conio.h>
#include
"dynamixel.h"
#define
COM_PORT_NUM
#define
BAUD_RATE_NUM
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 )
17
//Comport Number of USB2DXL
1
//Baudrate Number of Dynamixel PRO
Bps(= bit per seconds)
2400 bps
57600 bps
115200 bps
1 Mbps
2 Mbps
3 Mbps
4 Mbps
4.5 Mbps
10.5 Mbps
17
//Comport Number of USB2DXL
1
//Baudrate Number of Dynamixel PRO. 1 is 57600 bps
Page 41 / 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?

Table of Contents