Académique Documents
Professionnel Documents
Culture Documents
Raspberry Pi
st 3
rd
Moldamurat Khuralay
th
5 Gagarina L. G.
1 Brimzhanova S.S.
Doctoral student 2 year of study of Candidate of technical Sciences, Doctor of technical sciences,
the specialty 6D060200 - associate professor ofthe Foreign Scientific Consultant,
«Informatics» of KSU after Department of Space Technology Professor of the National Research
A.Baitursynov, Kazakhstan, and Technology of the ENU named University «MIET», Russia.
Kostanai. T.: 8-707-639-95-30. after L.N. Gumilev. T.: 8-775-819-
90-33.
E-mail address:
kameshova_88@mail.ru E-mail address:
nd moldamurat@yandex.ru
2 Atanov S. K. th
Supervisor, Doctor of Technical 4 Kobelekov K.S.
Sciences, professor of the ENU Doctoral student 1 year of study of
named after L. N. Gumilev. the specialty «Computers and
software» of the ENU named after
L.N. Gumilev.
(also called machine code and machine command language). power of reflection at runtime. A fast, statically typed, compiled
Initially, all programs were written in machine code, but now this language looks like a dynamically typed, interpreted language.
is practically not done anymore. Instead, programmers write the
source code in one or another programming language, then, using 2 RASPBERRY PI
the compiler, translate it in one or several stages into machine Anyone who is interested in robotics, DIY electronics, has heard
code, ready for execution on the target processor, or in an of Arduino and Raspberry Pi boards. Both are rather popular
intermediate representation, which can be executed by a special boards (single-board computers). Not surprisingly, they are often
translator - a virtual machine. But this is true only for high-level perceived as analogues and even as competing hardware platforms
languages. If full low-level control over the system is required at designed to solve the same tasks. In fact, the Arduino and the
the level of machine instructions and individual memory cells, the Raspberry Pi have many differences. The first thing you should
programs are written in assembly language. The mnemonic pay attention that the Raspberry Pi is a full-featured computer,
instructions of this language are converted one-to-one into the while it is very difficult to call the Arduino as a computer.
corresponding instructions of the machine language of the target
computer processor (for this reason, translators from assembly Raspberry Pi is a single-board computer that means various parts
languages are defined as algorithmically simple translators). The of a computer, which are usually located on separate boards, are
text editor of the programming environment can have specific represented here on one [2]. In addition, this board has a relatively
functionality, such as indexing names, displaying documentation, small size - about 8.5 * 5.5 cm. The product name are combined
syntax highlighting, and visual user interface creation tools. by Raspberry - raspberry and Pi - Pi number. The raspberry image
became the project logo. Raspberry Pi is released in three
Using a text editor, the programmer produces typing and editing variations: A, A +, B and B +. The most popular model is B, B +
the text of the created program, which is called the source code. A is gaining popularity since it has been released recently [3]. The
programming language defines the syntax and initial semantics of newest and cheapest version of A + may be a hit due to its price
the source code. Integrated development environments are [4]. To start working with the Raspberry Pi, in addition to the
currently widely used in the process of programming. They board itself, you will need:
usually include:
• code editor for entering and editing program text; the
SD card from which the operating system is loaded;
manufacturer recommends using a card from 8 to 32 Gb;
• debugger for debugging (search and elimination of errors);
a monitor or TV with HDMI, DVI or RCA connectors
• translator to convert the text of the program into a machine (for models A and B only), and, accordingly, an HDMI-HDMI
representation; cable,
HDMI-DVI or RCA-RCA, you can also use an HDMI-
VGA converter;
• linker for building a program from several modules;
USB keyboard;
• other service modules and tools. USB mouse;
Programming is the art, craft and science of writing programs that Power cable or micro USB battery.
determine how a computer will work. A new player has appeared
3 RASPBIAN
on the programming language market - the Golang programming
language, or Go from Google. Go is a general-purpose language Raspbian is a Debian-based operating system for the Raspberry
with wide capabilities and clear syntax [1]. Thanks to Pi [5]. There are several versions of Raspbian, including Raspbian
multiplatform, reliable, well-documented standard library and Stretch and Raspbian Jessie. Since 2015, the Raspbian has
focus on convenient approaches to the development itself, Go is officially introduced the Raspberry Pi Foundation as the main
the ideal language for the first steps in programming. Google operating system for single-board computers [6] Raspberry Pi.
announced the Go language in 2009, and since then it has changed Mike Thomson and Peter Green as an independent project [7]
a little, but its goals and objectives remain the same: this language created Raspbian. The initial assembly was completed in June
is intended for system programming and is inherently very similar 2012 [8]. The operating system is under active development.
to C ++. The Go language is a compiled and multi-threaded Raspbian is optimized for low-performance ARM processors [9]
general purpose language that has many common features with used in the Raspberry Pi line of computers.
the C ++ language, therefore, for successful mastering of the
presented material, certain knowledge in C ++ is required. Go - PIXEL (Pi Improved Xwindows Environment, Lightweight) is
expressive, concise, clean and effective. Concurrency mechanisms used as the main desktop environment in Raspbian. It consists of a
simplify the writing of programs that make the most of multi-core modified LXDE [10] desktop environment and an Openbox [11]
and network machines [16]. Its new type system provides flexible window manager with a new theme and several other changes.
and modular construction of programs. Go quickly compiles to The distribution comes with a copy of the Mathematica computer
machine code, but has the convenience of trash collection and the algebra program [12], a special version of Minecraft [13] called
ICEMIS'19, June 6–8, 2019, Nur Sultan, Kazakhstan © 2019 Copyright is held by the authors: S. Brimzhanova, S. Atanov,
L. Gagarina, Moldamurat Khuralay, Kobelekov K.S.
GOTOOLDIR="/usr/lib/go-1.7/pkg/tool/linux_arm" If you do not have a github account, you can use any other
external repository account, but it's best to use your Github
CC="gcc" account to clearly define your projects.
GOGCCFLAGS="-fPIC -marm -pthread -fmessage-length=0 - 7. Add the "hello world" project to verify the installation.
fdebug-prefix-map=/tmp/go-build187598155=/tmp/go-build -gno-
record-gcc-switches" a) First create a project folder and cd in its directory.
b) Using an optional editor, we create a main.go file with the CPU architecture: 7
following contents (Figure 1). CPU variant : 0x0
If you receive an error message, you need to fix it urgently! hello-go helloworld
Carefully check the spelling and cases (Go is case sensitive). pi@pi3-2:~/go/src/pi/helloworld $
d) Next you should format the code: h) If everything is done correctly, it can be started by our user pi
pi@pi3-2:~/go/src/pi/helloworld $ go fmt from anywhere, just by typing the command name:
Without a filename, it will correctly (re-) format all source files in pi@pi3-2:~/go/src/pi/helloworld $ helloworld
this directory and below. Hello world! Greetings from Raspberry Pi
e) Then create a helloworld as an executable procram, inside this pi@pi3-2:~/go/src/pi/helloworld $ cd ~
directory.
pi@pi3-2:~ $ helloworld
To compile the source code on go and then run the resulting
binary on raspberry pi, you need to set certain env-variables Hello world! Greetings from Raspberry Pi
before compiling. pi@pi3-2:~ $
For different versions of Raspberry Pi you need to specify Currently, go language support is on Windows, Linux, MacOS
different versions of ARM. You can find out exactly what you and FreeBSD platforms. Due to this article wascreated golang
need in / proc / cpuinfo: executable code for ARM processors. In addition to the compiler
# cat /proc/cpuinfo from Google, there is also the gccgo compiler from the GNU
collection.
Processor : ARMv6-compatible processor rev 7 (v6l)
REFERENCES
BogoMIPS : 697.95
[1] Go programming language - [Electronic resource],
Features : swp half thumb fastmult vfp edsp java tls
URL: https://golang.org/.
CPU implementer : 0x41
ICEMIS'19, June 6–8, 2019, Nur Sultan, Kazakhstan © 2019 Copyright is held by the authors: S. Brimzhanova, S. Atanov,
L. Gagarina, Moldamurat Khuralay, Kobelekov K.S.