Data Sheet
4/27/2018 OpenCR1.0
http://emanual.robotis.com/docs/en/parts/controller/opencr10/ 47/50
OpenCR 05 Joystic Example
7. 8. Dynamixel Workbench
7. 8. 1. Find Dynamixel
When you get a Dynamixel first, you need to know what ID and Baud rate is. This example
find out ID and Baud rate of connected Dynamixels.
begin function set PortHandler and PacketHandler. scan function ping all Dynamixels. After
get Dynamixels, you can check ID and Baudrate of its.
/*******************************************************************************
* Copyright 2016 ROBOTIS CO., LTD.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*******************************************************************************/
/* Authors: Taehun Lim (Darby) */
#include <DynamixelWorkbench.h>
#define DXL_BUS_SERIAL1 "1" //Dynamixel on Serial1(USART1) <-OpenCM9.04
#define DXL_BUS_SERIAL2 "2" //Dynamixel on Serial2(USART2) <-LN101,BT210
#define DXL_BUS_SERIAL3 "3" //Dynamixel on Serial3(USART3) <-OpenCM 485EXP
#define DXL_BUS_SERIAL4 "/dev/ttyUSB0" //Dynamixel on Serial3(USART3) <-OpenCR
#define BAUDRATE_NUM 3
DynamixelWorkbench dxl_wb;
void setup()
{
Serial.begin(57600);
while(!Serial); // Open a Serial Monitor
uint8_t scanned_id[16] = {0, };
uint8_t dxl_cnt = 0;
uint32_t baud[BAUDRATE_NUM] = {9600, 57600, 1000000};
uint8_t index = 0;
uint8_t range = 100;
while (index < BAUDRATE_NUM)
{
Serial.println(String(baud[index]) + " bps");
dxl_wb.begin(DXL_BUS_SERIAL4, baud[index]);
dxl_wb.scan(&scanned_id[0], &dxl_cnt, range);
OpenCR1.0
Back to Top ▲