Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

How to apply to your program

Doi Yusuke edited this page Nov 27, 2016 · 10 revisions

Method of apply

  1. Installation
  2. Include
  3. Use
  4. Compile
  5. Usage of your program

Installation

Reference README.md

Include

Your program need that code onto top:

#include<ics3/ics>

Use

Create ICS3 instance:

ics::ICS3 ics3 {"/dev/ttyUSB0", ics::Baudrate::RATE115200()}
// Create ICS3 instance to complete setting of communication

Get some Instance:

constexpr ics::ID id {1}; // Create servo ID is 1
auto target = ics::Angle::newDegree(40); // Create Angle is 40°

Use instances:

auto now_degree = ics3.move(id, target); // the servo(id:1) move to 40°
                                         // and return "now" position

More information: API Reference

Compile

Caution

You must use c++11 supported compiler.

Hand compile

You should compile with -lics3.

g++ -std=c++11 -lics3 yourcode.cpp

Cmake based compile

You should specify ics3 on TARGET_LINK_LIBRARYS for compiler to find libics3.

Usage of your program

Mount serial device

First, Linux need serial communication device mounted. you should mount your serial communication driver.

script/setup.sh will mount device of serial UBS adapter series. It is interactive shell script. You can mount a your device.

example

$ sh script/setup.sh
Please select your device
1. ICS USB ADAPTER
2. SERIAL USB ADAPTER
3~5: nothing
6. ICS USB ADAPTER HS
7. SERIAL USB ADAPTER HS
8. DUAl USB ADAPTER HS
> 

If you have DUAL USB ADAPTER HS and you want use it...

> 8<Enter>

setup.sh mount your device.

Run the your program

you can run the your program!