This repository has been archived by the owner on May 6, 2020. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 0
How to apply to your program
Doi Yusuke edited this page Nov 9, 2016
·
10 revisions
Reference README.md
Your program need that code onto top:
#include<ics3/ics>
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 informetion: API Reference
You must use c++11 supported compiler.
You should compile with -lics3
.
g++ -std=c++11 -lics3 yourcode.cpp
You should specify ics3
on TARGET_LINK_LIBRARYS
for compiler to find libics3.
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.
$ 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.
you can run the your program!