-
Notifications
You must be signed in to change notification settings - Fork 31
/
Copy pathREADME
187 lines (123 loc) · 5.54 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
____ __ ____ ___ ____ __ (((((()
| |_ \ \ / ) ) | | ) | |_ \ \ / \(@)- /
|_|__ \_\/ __)_) |_|_/ |_|__ \_\/ /(@)- \
((())))
___ __________________________________
___ VERSION __________________________________
ev3dev-c 2.0a1.dev5
2019-08-04
kernel 4.14.117-ev3dev-2.3.4-ev3
___ ______________________________
___ WHAT IS IT? ______________________________
ev3dev-c is a C library for LEGO MINDSTORMS EV3 Debian Linux
(http://www.ev3dev.org/) which wraps access to the EV3 hardware.
The library also supports remote access to the EV3 brick over a network.
So, if you configure WLAN on the brick, you can control the EV3 hardware
from a remote computer, for example, running under Windows.
___ __________________________
___ GETTING STARTED __________________________
Before you start, make sure that you have opened an SSH connection
to your EV3 brick.
You need to install the compiler and other tools:
sudo apt-get update
sudo apt-get install build-essential
sudo apt-get install git
Then, clone the library repository and its submodules to the directory
of your choice, such as "/home/robot/ev3dev-c":
cd /home/robot/
git clone https://github.com/in4lio/ev3dev-c.git
cd ev3dev-c/
git submodule update --init --recursive
Compile and install static and shared libraries:
cd source/ev3/
make
sudo make install
make shared
sudo make shared-install
It's the right time to take a look at a small example. "hello.c" outputs
a greeting as well as toggles the left LED color:
cd ../../eg/hello/
more ./hello.c
Let's compile and run this program. Note that we link our example with
a static library:
gcc hello.c -lev3dev-c -o hello
./hello
See also:
http://www.ev3dev.org/docs/tutorials/getting-started-with-c/
___ ____________________
___ PYTHON, RUBY and PERL ____________________
Python (see "python/ev3dev" folder), Ruby (see "ruby" folder) and
Perl (see "perl" folder) libraries are automatically generated from
C library using SWIG tool.
Use pip to install ev3dev-c Python package:
pip install ev3dev-c
ev3dev-c Python package contains the following binary modules:
_ev3.pyd – for remote control from Windows (x86)
_ev3.so – for LEGO MINDSTORMS EV3 Debian.
You have to install "python-dev", "ruby-dev" and "libperl-dev"
packages to build the corresponding libraries.
___ _________________________________
___ GET HELP _________________________________
Documentation generated by Doxygen can be found on
http://in4lio.github.io/ev3dev-c/
___ ____________________________________
___ F A Q ____________________________________
* * * What are unusual ".yu", ".yu-с" and ".yu-h" files for?
ev3dev-c is written using yupp lexical preprocessor – but don't
panic – the generated source files in C also included.
* * * How can I see some examples
Comprehensive example based on coroutines:
http://in4lio.github.io/ev3dev-c/drive_8c-example.html
An example of IR remote control using "brick" simplified library:
http://in4lio.github.io/ev3dev-c/remote_8c-example.html
http://in4lio.github.io/ev3dev-c/remote_8py-example.html
Further examples in C:
https://github.com/in4lio/ev3dev-c/tree/master/eg/
light.c – LEDs blinking example
sensor.c – TOUCH and COLOR sensors usage
tacho.c – TACHO motor running for 5 sec
port.c – Use of EV3 ports
dc.c – Use of a DC motor
rcx_led.c – Use of a RCX LED
servo.c – SERVO motor example
Similar examples also avaible in Python ("python/ev3dev/eg"),
Ruby ("ruby/eg"), and Perl ("perl/eg").
* * * How to make an example
For instance, to compile "light.c" example:
cd ev3dev-c/eg/light/
make
./Debug/light
or, if you are running Windows:
.\Debug\mingw\light.exe
* * * How to control the EV3 hardware remotely
https://github.com/in4lio/ev3dev-c/tree/master/source/ev3/ev3_link/
* * * How to make and install STATIC library
cd ev3dev-c/source/ev3/
make
sudo make install
* * * How to make and install SHARED library
cd ev3dev-c/source/ev3/
make shared
sudo make shared-install
* * * How to use SHARED library
cd ev3dev-c/eg/port/
gcc port.c -lev3dev-c -o port
./port
___ ______________________________________
___ GIT ______________________________________
Run the following on your command-line to clone the library
repository and its submodules:
git clone https://github.com/in4lio/ev3dev-c.git
cd ev3dev-c/
git submodule update --init --recursive
Pull the latest library and its submodules:
cd ev3dev-c/
git pull origin master
git submodule foreach git pull origin master
___ __________________________________
___ CONTACT __________________________________
Please feel free to contact me at [email protected] if you have
any questions about this library.
___ __________________________________
___ LICENSE __________________________________
Please see the file called "LICENSE".