OLIMEX© 2012
OLinuXino-MAXI user's manual
program. For example:
& vi /etc/resolv.conf
Press
d
several times to remove all lines. Press
I
to enter insert mode. Type:
& nameserver 192.168.0.1
(Again this is example. You should add you DNS-server.)
After you finish entering this press
Esc
. This will set the program in command mode. In
command mode press:
& :wq
This should do the work. To check connection use
ping
. If it doesn't check your
configuration again and router settings. You can use
ifconfig
to see OLinuXino settings.
III. Using GCC to make Hello_World
In the home folder there are some examples
& cd /home/examples
& ls
And you should see all files and folders. You can create new folder (if you want) with the
command:
& mkdir <some dir>
To see our HelloWorld program go to
/HelloWorld
folder
& cd /home/examples/HelloWorld
& ls
In this folder are two files:
- hello
- hello_world.c
The C file is the sourse code. Actually this is text file with .c extention. Type
vi
or
cat
hello_world.c to view the source. You could modify the source whatever you want. After
the source is ready to compile the file use:
& gcc -o hello_world.c hello
For more complicated compiling type:
& man gcc
To execute the program:
& ./hello <some name>
The result of the execution should be:
Hello <some name>.
In the other directory /home/i2c are three examples for hardware I2C. You could compile
them using the same command:
& gcc -o <file>.c <file>
Page 18 of 60