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 Oct 27, 2016 · 10 revisions

Method of apply

  1. Installation
  2. Include
  3. Use
  4. Compile

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 nowAngle = obj.move(id, target); // the servo(id:1) move to 40°
                                      // and return 'now' position

More informetion: API Reference

Compile

CAPTION

You must use c++11 supported compiler.

Hand compile

You should specify -lics3 for compiler to find libics3.

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

Cmake based compile

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

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.

Run the your program

you can run the your program!

Clone this wiki locally