Design of IoT Laboratory Exercises
Design of IoT Laboratory Exercises
Bachelor’s Thesis
MARTIN MOJŽIŠ
Bachelor’s Thesis
MARTIN MOJŽIŠ
Martin Mojžiš
iii
Acknowledgements
I would like to thank my supervisor Ing. Václav Oujezský, Ph.D. for
all the support, time and advice he provided during my work on this
thesis. I am also grateful to my family and friends for supporting me
while I was writing this thesis.
iv
Abstract
In this thesis, laboratory exercises related to Internet of Things are
designed and programmed. Different microcontrollers are used for
programming the exercises, and difficulty of implementation of the
exercises is compared for each of these devices. The used devices are
microcontrollers STM32, Raspberry Pi Pico, and Rock Pi S, which also
are described in this thesis. The designed exercises concern program-
ming of I/O devices, namely rotary encoder, LCD, shift register and
buttons. It is explained how these I/O devices work and how to pro-
gram them. For programming, Arduino IDE and Python was used.
The used microcontrollers are compared regarding their suitability for
programming of the exercises. It was discovered that from the used
microcontrollers, the most suitable for programming these exercises
is the STM32.
Keywords
Exercises, Internet of Things, Lasaris, Microcontroller
v
Contents
Introduction 4
1 Description of microcontrollers 6
1.1 STM32 microcontroller . . . . . . . . . . . . . . . . . . . 6
1.2 Raspberry Pi Pico . . . . . . . . . . . . . . . . . . . . . . 9
1.3 MH-Tinny Attiny88 . . . . . . . . . . . . . . . . . . . . . 11
1.4 Rock Pi S . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
1.5 Comparison of microcontrollers . . . . . . . . . . . . . . 12
2 Design of exercises 13
2.1 Devices used . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.2 Exercises . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.2.1 LCD and rotary encoder . . . . . . . . . . . . . . 14
2.2.2 Shift register and buttons . . . . . . . . . . . . . 16
3 Programming of microcontrollers 19
3.1 Programming of STM32 . . . . . . . . . . . . . . . . . . 19
3.2 Programming of Raspberry Pi Pico . . . . . . . . . . . . 22
3.2.1 Arduino IDE . . . . . . . . . . . . . . . . . . . . . 22
3.2.2 MicroPython . . . . . . . . . . . . . . . . . . . . 24
3.3 Programming of Rock Pi S . . . . . . . . . . . . . . . . . 25
3.4 Comparision of complexity of programming exercises
for different microcontrollers . . . . . . . . . . . . . . . 27
3.5 Advantages and disadvantages of individual microcon-
trollers used in practical exercises . . . . . . . . . . . . . 28
3.6 Encountered problems with microcontrollers . . . . . . 29
4 Conclusion 32
Bibliography 34
A Lasaris Boards 37
vi
List of Figures
2.1 STM32 board with LCD. . . . . . . . . . . . . . . . . . . . 15
2.2 STM32 board with shift register. . . . . . . . . . . . . . . . 17
3.1 IDE configuration. . . . . . . . . . . . . . . . . . . . . . . . 20
A.1 STM32 base board [29]. . . . . . . . . . . . . . . . . . . . . 37
A.2 RS485 communication board [29]. . . . . . . . . . . . . . . 37
A.3 LCD application board [29]. . . . . . . . . . . . . . . . . . 38
vii
List of Listings
3.1 Includes and initialization of LCD. . . . . . . . . . . . . 21
3.2 Rotary encoder pins definition and initialzation. . . . . 21
3.3 Import and initialization of LCD controller. . . . . . . . 26
3.4 Example of usage of LCD controller. . . . . . . . . . . . 27
3.5 Finding right I2C address. . . . . . . . . . . . . . . . . . 28
1
Abbreviations
CAN Controller Area Network 7
I/O input/output 4
KB kilobyte 7
MHz Megahertz 7
PC personal computer 13
2
Abbreviations
SD Secure Digital 11
TN Twisted-Nematic 14
3
Introduction
“The term Internet of Things (IoT) generally refers to scenarios where
network connectivity and computing capability extends to objects, sen-
sors and everyday items not normally considered computers, allowing
these devices to generate, exchange and consume data with minimal
human intervention (1, p. 1)”. The IoT is created by interconnected
devices which have sensors, and processors, and can communicate
with each other. IoT does not have to be connected to the World Wide
Web and has many uses and applications.
It is used by consumers as part of home automation, which can,
for example, help save energy, and sometimes even for assistance to
disabled or elderly people. IoT is also used by organisations, for exam-
ple by Medical and Healthcare ones for data collection, and analysis,
which helps with research. Other Healthcare use is the monitoring of
patients. IoT is also used by organisations for transportation, where it
can help with traffic control, parking, or logistics. Industrial uses of
IoT include automation or semi-automation of manufacturing, which
speeds up manufacturing and helps produce different products faster.
IoT can also be used in agriculture, for monitoring weather, soil con-
tent and pest infestation, these data can increase farming productivity
and help with decisions regarding farming. There are even more uses
of IoT, so it can be seen that IoT is quite useful.
In this thesis, it will be shown how to program some basic in-
put/output (I/O) devices using microcontrollers. The goal of this
thesis is to design two exercises concerning the IoT. These exercises
will however be programmed for three different microcontrollers.
These microcontrollers are on different base boards, made by Lasaris
laboratory, and can be connected to the same I/O devices which are
on another board. The microcontrollers used are STM32, Raspberry
Pi Pico, and, finally, RockPi.
Another goal of this thesis is to compare these microprocessors
regarding their approachability while programming. Questions that
will concern us are: Which microprocessor is the easiest to program
on? Which microprocessor is the easiest to set up? This thesis points
these questions.
4
Introduction
5
1 Description of microcontrollers
Firstly, what are microcontrollers will be explained. A microcontroller
is a chip that has its own processor, and many more components.
These components include flash memory, RAM, digital and analogue
I/O circuits, interrupts, and timer. They can even have other fea-
tures (Gridling; Weiss [2], 2007). Microcontrollers, unlike micropro-
cessors, are used in embedded devices. They have usually low perfor-
mance but are very power efficient because they need to be powered
on all the time when used. Microcontrollers are used in lots of today’s
electronic devices. Some microcontrollers can even communicate with
each other. With this rich connectivity, microcontrollers have a broad
range of use.
The I/O can be analogue or digital and is usually managed through
pins. The pins can therefore be analogue or digital, while more of them
can be used at once to provide one functionality. Thanks to pins, there
are a lot of sensors and I/O devices that can be connected to the micro-
controllers. Most of the pins are exposed for use to connect peripherals
such as buttons, keyboards, environmental sensors, devices for vari-
ous measurements, biometric devices, displays, or devices providing
more storage for microcontrollers. More specific examples are push
buttons, temperature sensors, rotary encoders, proximity sensors, Liq-
uid Crystal Display (LCD) displays, shift registers, or LED diodes. IoT
is a set of microcontrollers which are programmed and interconnected,
and are able to exchange data and cooperate.
Microcontrollers can be programmed from a computer. For con-
nection to the computer, the microcontrollers can support serial port
interface, or even have Universal Serial Bus (USB) port. Some have
an ethernet port, or wireless connections such as Wireless Fidelity
(Wi-Fi) and can be connected to the network. The microcontrollers are
usually pre-programmed with a bootloader that helps with uploading
programs from the computer to the microcontroller’s own memory.
6
1. Description of microcontrollers
7
1. Description of microcontrollers
8
1. Description of microcontrollers
This board has no operating system and the only program run-
ning on it will be the one uploaded to it, therefore, it is bare metal
programmable. The program can be written in Arduino integrated
development environment (IDE), compiled there, and uploaded to
the microcontroller by it.
Arduino IDE is a cross-platform software developed by Arduino
Software. As is stated in official internet page of this IDE, in this
application, it is possible to write a program, compile it, and, finally,
upload it to an Arduino board. It has a text editor for writing programs,
a boards manager which allows the user to choose for which board
should the program be compiled, a library manager with various
libraries for controlling I/O devices, a serial monitor for receiving and
sending messages to the connected board, and few other functions
which are similar to other well known IDEs (12).
The board manager provides functionality to select even other
boards, different from Arduino ones. Therefore, we can even program
STM32 with this IDE. In this thesis, version 2.0 of Arduino IDE is used,
which is different from the original one mainly in design. One of the
new functionalities is a debugger, but it will not be needed in this
thesis.
9
1. Description of microcontrollers
1. https://learn.sparkfun.com/tutorials/serial-peripheral-interface-spi/all
10
1. Description of microcontrollers
1.4 Rock Pi S
The last microcontroller for which the exercises will be programmed
is Rock Pi S. This microcontroller is a type of microcontroller which
is also called a single-board computer (SBC). This means it has an
operating system running on it, which is usually Linux.
The Rock Pi S is similar to Raspberry Pi Zero, which is a more well-
known SBC. Rock Pi S is also the most powerful of the microcontrollers
used for the exercises, which will be programmed in another part of
this thesis. In fact, it has a 64-bit quad-core processor, ARM Cortex-A35
CPU, which is capable of audio processing and use for other digital
multimedia, and 256 MB of RAM.
Based on the microcontroller’s official website, it also has 52 pins,
including analogue and digital pins, an ethernet port, and a Micro
Secure Digital (SD) card reader (19, 20). It is also stated that its pro-
cessor supports audio interfaces, for example, pulse-code modulation
(PCM), time-division multiplexing (TDM) and so on. The pins on
the board support three PWM, two SPI, two I2C and three UART. On
the board, there is also a USB 2.0 (20). PCM is used for representing
audio streams digitally. According to the explanation of it, it was in-
vented in 1939 and was designed to allow communication in digital
form to be sent by analogue media. This method; however, also works
for representing audio in digital form, by means of sampling and
quantizing. There are multiple variants of PCM, depending on the
11
1. Description of microcontrollers
method used to quantize the audio data. The PCM is mainly used in
CDs and other forms of audio. Variants with compression are used
in telephony (21). Rock Pi S supports PCM, therefore, it can process
audio data. A Micro SD card is also needed for working with a micro-
controller because the Micro SD card contains a bootable operating
system which runs on the board. An operating system is needed to
programme the board. The Rock Pi S can be programmed with the
help of libraries, such as libmraa, which will be used in this thesis and
needs to be installed on the operating system of the board, for working
with I/O. The libmraa is a C/C++ library which can be used also with
Python and Java. According to the official libmraa site, it provides
functions to communicate with I/O devices. GPIO, I2C, PWM, SPI,
and more can be controlled by this library. What is more, the libmraa
supports many different boards, such as Raspberry Pi, Intel Edison,
and Rock Pi 4 (22). This makes code more portable and is good for
sensor developers and programmers. Languages used for program-
ming are for example C language or Python, but any language which
is supported by the libmraa library can be used.
12
2 Design of exercises
I/O devices will be used in the upcoming exercises. In the first exercise,
an LCD and a rotary encoder will be used together. In the second
exercise, buttons and a shift register will be used. The goal of the
exercises is to understand how to use the peripheral devices connected
to microcontrollers, which means writing programs which will use
them.
Programs do not have to be very complicated, because these exer-
cises are focused mainly on programming the microcontrollers. After
doing the upcoming exercises, the student should be able to use the mi-
crocontroller and peripherals connected to it such as LCD and rotary
encoder or the buttons and shift register, even for larger projects.
13
2. Design of exercises
connection of the devices on each board with the base board. Therefore,
there are connecting pins, which interconnect the boards. Because of
that, the pins do not have to be connected manually to the devices by
the user.
Base boards and application boards will be used in this thesis for
programming exercises. What is more, these boards can also be re-
placed by different ones. This will be taken advantage of, and different
application boards and base boards will be used in exercises.
One of the used application boards has an LCD display and rotary
encoder, while another one has a shift register and buttons. Base boards
have microcontrollers from the first chapter(1) on them.
2.2 Exercises
14
2. Design of exercises
RS-485
Rotary
encoder
STM32
I2C LCD
Power
supply IO
15
2. Design of exercises
16
2. Design of exercises
RS-485
Buttons
STM32
Shift register
Power
supply IO
17
2. Design of exercises
set the clock pin to 1 and then set it back to 0. Every time the clock
pin is set to 1, the data saved to the storage register are shifted by one,
and on the new place, which is freed by this shift, the state of the data
pin is stored. After each store of data, the clock pin has to be set back
to 0. After storing data in the storage register like this, the latch pin
is used to send the data from it to the output pins. The latch pin has
to be set to 1 and then the clock pin from 0 to 1 to do this. After this,
the clock pin is recommended to be set to 0, to prepare it for the next
action which will use it. After the data are sent to the output pins,
we can continue by sending data to the storage register of the shift
register (24).
This shift register also has LED diodes on it, when some pins are
activated, the led diodes connected to them turn on. When they are
deactivated, LEDs turn off. Thanks to this, what is sent to the shift
register, and which pins are turned on can be seen.
Other peripheral devices used in this exercise are buttons. Buttons
are input devices and have two logical states, high or low. To avoid
randomness in case of a disconnected button or strong interference
from the environment, the input_pullup mode will be used in our
program. The state of the button is defaultly high, and when the button
is pressed down, its status becomes low. This mode of working with
buttons uses internal resistors on the microcontroller for cancelling
out false signals.
The goal of this exercise is to write a program which will use both
devices, buttons and also the shift register. Such a program is one that
will set the pins at the shift register to different states when different
buttons are pressed. For example, all pins on the shift register will be
set to 1 when the first button will be pressed. Secondly, pins will be
turned on one by one when the second button will be pressed, and
finally, every other pin will be turned on when the third button will
be pressed. After every press of a button that causes a change to the
shift register, the program will wait for the end of the action caused
by this press. Basically, the program will not allow other input while
the shift register is set to wanted state for specific time. For example,
turning all of the pins on for half a second, after which all the pins
will be set back to 0. This waiting will be applied to all of the actions
with buttons. This is the exercise that will be programmed for the shift
register and the buttons.
18
3 Programming of microcontrollers
For programming STM32 and Raspberry Pi Pico, the Arduino IDE
was used. In the IDE, the right model of the microcontroller for which
the program is being written needs to be selected. Another thing to
be taken into account is that the I/O pins for communication with
peripheral devices are usually differently named for each microcon-
troller. Because of that, the documentation of each board is needed to
be checked and the right pins used.
The programming in Arduino IDE is done in C language. When
programming microcontrollers in Arduino IDE, there are always 2
functions. These are setup(){} and loop(){}. setup(){} is done only
once, at the beginning of the program. loop(){} is done after setup
infinitely, until the microcontroller is turned off or does not have power.
In the setup(){} function, usually the pins used in loop(){} are set up
and variables declared. loop(){} is basically an infinite loop and is
used like the main body of a program. In exercises, these functions
will be treated as described.
In the exercise with LCD and rotary encoder, the text on LCD will
be changed at the same time as the status of rotary encoder or its
button. In this exercise, interrupts can be used. The updates of the
LCD can be launched only when some signal change occurs on one of
the static pins on the rotary encoder. Using interrupts has advantages
over using just the loop(){} function. To know whether something
has happened with the rotary encoder, the device does not have to be
looping through the loop(){} function. Therefore, the processor will
be less utilized. With the use of interrupts, the loop function can be
left empty and what the LCD displays will be changed only when a
signal from the encoder will be received. The loop function can then
be used to do other necessary steps of the program faster.
19
3. Programming of microcontrollers
20
3. Programming of microcontrollers
It has already been explained how to read information from the ro-
tary encoder at section 2.2.1, so the program works according to the
explanation. The reading of info from rotary encoder in the sample
program is inspired by (25). Pins had to be defined by the function
pinMode, which is built in Arduino IDE. The definition of pins for the
rotary encoder and their initialization can be seen in Listing 3.2.
void setup () {
// initialize input pins
pinMode ( CLK , INPUT ) ;
pinMode ( DT , INPUT ) ;
pinMode ( BTN , INPUT_PULLUP ) ;
21
3. Programming of microcontrollers
22
3. Programming of microcontrollers
reset, the File Manager window should pop up. It can be ignored if the
Arduino IDE is used to write the program which will be uploaded.
When a program is uploaded for the first time, it is needed to select
Raspberry Pi Pico as the board for which to compile a program in IDE.
To upload a program again, the microcontroller has to be either reset
or selected in the IDE as a device on a port.
To reset the board, it is needed to disconnect it from the PC and hold
the Bootsel button on it while connecting it to PC. However, after the
first upload, the Arduino IDE should recognize the connected device
automatically. If it does not, the device has to be selected manually. To
select it, it is needed to know how it is connected to the PC. It should
be visible in the device manager (in Windows) under Ports, while
the device should be connected to one of the communication port
(COM)s. The microcontroller is connected to one of the COM ports,
the same one as in the device manager so that port should be selected
in the IDE. Finally, a program can be compiled and uploaded to the
board, in a similar fashion as on STM32.
If the microcontroller is connected to the PC via a micro USB cable,
the serial monitor functionality in the Arduino IDE can be used. This
functionality allows the PC to communicate with the microcontroller
and vice versa. This can be used even while a program is running on
the microcontroller.
To use the serial monitor, the microcontroller has to be connected
to the IDE, which means it must be selected there as a device on
a port. Then, we can open a serial monitor in the IDE and send or
receive messages from the microcontroller in the program uploaded
to Raspberry Pi Pico. This can be used for sending info from the rotary
encoder to the PC.
The programs programmed in Arduino IDE are similar to the ones
programmed for STM32. One of the exceptions is the pins used. The
pins have to be redefined from the ones used on the STM32, to the
pins which are on the Raspberry Pi Pico, corresponding to the ones on
the STM32 on the Lasaris boards. They can be found in the Hardware
description document. When using the pins in the Arduino IDE, just
the number of pins has to be written, for example, not GP11 as is
written in the Hardware description, but only 11.
23
3. Programming of microcontrollers
3.2.2 MicroPython
Raspberry Pi Pico can be programmed in MicroPython too. MicroPy-
thon does not support the full Python 3 library, but, on the other hand,
it is less hardware-demanding. To make the MicroPython work, just
one file with MicroPython is needed to be uploaded to the board after
connecting it to PC, which can be found at MicroPython webpage (16).
As it has been mentioned, the program can be uploaded to the
board thanks to the mode in which the board is right after it has been
connected to the PC, holding the Bootsel button while connecting. An
File explorer window should pop up. After uploading the right file,
the board will restart and connect to the PC under one of the COM
ports.
A connection with the board can then be established from some
serial communication client such as Putty, or some IDE can be con-
nected to the board. The preferred method of connection is to use
the board from IDE such as Thonny. In Thonny IDE, the board needs
to be selected as an interpreter. This can be set in Thonny under the
option to Configure interpreter. There, Micropython for Raspberry Pi
Pico needs to be selected. The right port has also to be selected, but
IDE can detect on which port the board is connected automatically, so
this option will be used. After these steps, programs can be written
in Thonny and launched in IDE, although they will be executed on
Raspberry.
In MicroPython, libraries from Arduino IDE are not available, so
the LCD will not be used from MicroPython. However, in MicroPy-
thon, the print() function works as expected, so it is possible to write
24
3. Programming of microcontrollers
info from the rotary encoder to the console in the IDE, to which the
Raspberry Pi Pico is connected. This will be used in the exercise re-
garding the rotary encoder. The MicroPython can also be used for
working with shift register. How to do it is explained in next section
and this task is optional in exercises.
Again, sample solution programs and presentations explaining
these exercises can be found in B.
25
3. Programming of microcontrollers
26
3. Programming of microcontrollers
27
3. Programming of microcontrollers
28
3. Programming of microcontrollers
29
3. Programming of microcontrollers
Basically, the pins did not work. This was an issue because the board
behaved unexpectedly. When uploading simple programs, such as a
program for blinking the built-in led on the board, everything worked
flawlessly. The program could be uploaded, worked and when another
program had to be uploaded, it was possible too; however, when the
pins which were not working were used, the program got uploaded,
but it was not possible to communicate with the board from the PC or
upload another program. This occurred only when using the Arduino
IDE for programming. To get the board to work again, it had to be
reset. When only working pins were used, everything worked well.
When MicroPython was used for programming, if a program did not
work, the IDE used for programming would just throw an error and
programming could be continued. This issue can be resolved by reset-
ting board every time after unsuccessful upload from Arduino IDE to
it, or by using MicroPython for programming.
The same thing was happening when interrupts were used in Ar-
duino IDE with Raspberry Pi Pico. Namely, in the exercise using rotary
encoder, where interrupts were used for launching updates on LCD
and serial monitor when change on rotary encoder or button occurred.
After entering interrupt handler, the board became unresponsive. It
was not found out why this happens; however, this issue can be solved
by using loop function instead of interrupts.
Another issue encountered with Raspberry Pi Pico is that at the
time of writing this thesis, I2C did not work on the board used, or LCD
was not connected properly. Multiple I2C addresses were tested and it
was tried to look for them with the help of I2C scanner program, which
did not find any. Because of this, LCD is not tested with Raspberry Pi
Pico; however, after finding the right I2C address for connected LCD,
the program should work.
When programming the Rock Pi S, the shift register could not
have been controlled from it. When the pins used for controlling shift
register were set according to the hardware description, libmraa li-
brary threw an error saying that some of the pins were incorrectly
defined. After doing some research about libmraa library, how pins
are identified by this library, and studying how the Lasaris boards are
connected, it was found out that the pins in the hardware description
document were shifted by 4, because it included RJ45 pins to counting,
which are not included by libmraa. In hardware description, all the
30
3. Programming of microcontrollers
pins after the pin 26 are shifted by 4 because of this. It was stated that
the pins 47, 48, and 49 were the ones supposedly connected to the
shift register, so it was assumed that the pins 43, 44, and 45 are right.
When these were used, the program did not throw an error but did
not work either. After trying to fix it by changing the configuration of
the libmraa library, trying even different pins, testing with different
base boards (both with Rock Pi S), and programming the program
for controlling the shift register in C language, it was found that the
problem probably lies in the hardware. Therefore, the program using
a shift register and buttons was not tested with the Rock Pi S, the
buttons however work fine.
For I2C communication with LCD on the Rock Pi S, I tried to install
and use the eclipse upm library (28), which is based on libmraa and
provides abstraction from libmraa library to work with peripherals
using simple functions. It could not be installed simply with the help of
a package manager, apt in this case, so the library had to be built on the
Rock Pi S. However, the build failed because of needed prerequisites.
Even with them installed correctly, other errors when building the
library occurred. Therefore, the program mentioned in 3.3 was used,
which works and controls LCD.
31
4 Conclusion
In this thesis, two exercises were designed and programmed for three
different microcontrollers. These exercises used I/O devices, specifi-
cally LCD display, rotary encoder, buttons and shift register. The I/O
devices were connected to the microcontrollers by the boards made
by Lasaris laboratory.
The first exercise is to use the LCD display to display the direction
and the count of rotation of the rotary encoder. The second one is to
write a program which uses buttons to get input and controls the shift
register according to it.
The first microcontroller programmed is STM32, for which the
exercises are programmed using Arduino IDE and libraries provided
by this IDE. The second microcontroller used is Raspberry Pi Pico,
for which exercises are programmed in Arduino IDE and in MicroPy-
thon, although LCD is not used in MicroPython. The shift register
was programmed using pins in MicroPython. How the shift register
works is explained and the exercise can be programmed according to it.
The last microcontroller used for the exercises is the Rock Pi S, which
is programmed in Python, using libmraa library for communication
with pins. For this microcontroller, the shift register is programmed
similarly as for the Raspberry when using MicroPython. For program-
ming the LCD, a program with class which provides functions for
controlling the LCD is provided and can be used.
The second goal of this thesis was to compare microcontrollers. The
findings of this thesis are that the most approachable microcontroller
from those used is the STM32. This is because it is easiest to set up,
and libraries for I/O devices are available in the Arduino IDE. Thanks
to that, the programming on it is user friendly.
The second best microcontroller regarding approachability and
ease of use for these exercises is Raspberry Pi Pico. It can be pro-
grammed with Arduino IDE too; however, when some mistake re-
garding used pins was made in a program, the board had to be reset
manually. On the other hand, this microcontroller is more versatile,
because it can be programmed in MicroPython, which is based on
Python and is easier to program in than in C language.
32
4. Conclusion
33
Bibliography
1. ROSE, Karen; ELDRIDGE, Scott; CHAPIN, Lyman. The internet
of things: An overview. The internet society (ISOC). 2015, vol. 80,
pp. 1–50.
2. GRIDLING, Gunther; WEISS, Bettina. Introduction to microcon-
trollers. Vienna University of Technology Institute of Computer Engi-
neering Embedded Computing Systems Group. 2007.
3. STM32 32-bit Arm Cortex MCUs. Geneva: STMicroelectronics
N.V., 2023. Available also from: https : / / www . st . com / en /
microcontrollers - microprocessors / stm32 - 32 - bit - arm -
cortex-mcus.html.
4. STM32F103CB. Geneva: STMicroelectronics N.V., 2023. Avail-
able also from: https : / / www . st . com / content / st _ com / en /
products / microcontrollers - microprocessors / stm32 - 32 -
bit - arm - cortex - mcus / stm32 - mainstream - mcus / stm32f1 -
series/stm32f103/stm32f103cb.html.
5. MANKAR, Jayant; DARODE, Chaitali; TRIVEDI, Komal; KANOJE,
Madhura; SHAHARE, Prachi. Review of I2C protocol. Interna-
tional Journal of Research in Advent Technology. 2014, vol. 2, no.
1.
6. Road vehicles — Controller area network (CAN) — Part 1: Data link
layer and physical signalling. Geneva, CH, 2015. Standard. Interna-
tional Organization for Standardization.
7. SZYDLOWSKI, C. CAN specification 2.0: Protocol and implementa-
tions. 1992. Tech. rep. SAE Technical Paper 921603. Available also
from: https://doi.org/10.4271/921603.
8. GARBUTT, Mike. Asynchronous Communications with the PICmi-
cro® USART. Microchip Technology, AN774. 2003.
9. Understanding UART. Columbia, MD: Rohde & Schwarz USA,
Inc., 2023. Available also from: https://www.rohde- schwarz.
com/us/products/test-and-measurement/essentials-test-
equipment / digital - oscilloscopes / understanding - uart _
254524.html.
34
BIBLIOGRAPHY
35
BIBLIOGRAPHY
21. PCM, Pulse Code Modulated Audio. Washington, DC: The Library
of Congress, 2023. Available also from: https://www.loc.gov/
preservation/digital/formats/fdd/fdd000016.shtml.
22. Mraa 2.0.0. California: Intel Corporation, 2018. Available also
from: https://iotdk.intel.com/docs/master/mraa/.
23. Rotary Encoders. Kyoto: OMRON Corporation, 2023. Available
also from: https://www.ia.omron.com/support/guide/34/
introduction.html.
24. 74HC595; 74HCT595: 8-bit serial-in, serial or parallel-out shift register
with output latches; 3-state. Eindhoven: NXP B.V., 2011. Available
also from: https://www.electroschematics.com/wp-content/
uploads/2013/08/74HC_HCT595-datasheet.pdf.
25. How Rotary Encoder Works and Interface It with Arduino. Toronto:
Last Minute Engineers, 2023. Available also from: https : / /
lastminuteengineers.com/rotary-encoder-arduino-tutorial/.
26. Python-i2c-lcd. San Francisco: GitHub, 2023. Available also from:
https://github.com/sweetpi/python-i2c-lcd.
27. Integrated Development Environment for STM32. Geneva: STMicro-
electronics N.V., 2023. Available also from: https : / / www . st .
com/en/development-tools/stm32cubeide.html.
28. Eclipse UPM Sensor and Actuator Repository. San Francisco: GitHub,
2023. Available also from: https://github.com/eclipse/upm.
29. Lasaris. Brno: Faculty of Informatics, Masaryk University, 2023.
Available also from: https://lasaris.fi.muni.cz/.
36
A Lasaris Boards
37
A. Lasaris Boards
38
B Content of the Attachment
In the attachment, there is zip file with sample solutions for exercises,
program for controlling LCD from Rock Pi S, and presentations about
exercises. The .ino is format for Arduino IDE. This IDE also needs to
have these files in folders with the same name. Its content is as can be
seen below:
Presentations
Raspberry Pi Pico with LCD and rotary encoder
Raspberry Pi Pico with shift register
Rock Pi S with LCD and rotary encoder
Rock Pi S with shift register
STM32 with LCD and rotary encoder
STM32 with shift register
STM32
LCD_with_rotary_encoder
LCD_with_rotary_encoder.ino
shift_register_and_buttons
shift_register_and_buttons.ino
Raspberry Pi Pico
Arduino IDE
LCD_and_rotary_encoder
LCD_and_rotary_encoder.ino
shift_register_and_buttons
shift_register_and_buttons.ino
MicroPython
rotary_encoder.py
shift_register_and_buttons.py
Rock Pi S
rotary_encoder_and_LCD..py
shift_register_and_buttons.py
i2cLCDlib.py
39