NSWI170 Computer Systems [Archive 2022]

Labs

Before you get started, please, make yourself acquainted with authors' ethical guideline. It might prevent future misunderstandings regarding the authorship of your lab assignments.

If you have any questions or suggestions related to the labs, please contact your corresponding teacher.

David Bednárek #nswi170-compsys-bednarek Tuesday 9:00-10:30 (even weeks), N11 labs page
Tomáš Faltín #nswi170-compsys-faltin Thursday 10:40-12:10, N11 labs page
Martin Kruliš #nswi170-compsys-krulis Thursday 12:20-13:50, N8 [English] labs page
Martin Svoboda #nswi170-compsys-svoboda Tuesday 15:40-17:10, N11 labs page
Adam Šmelko #nswi170-compsys-smelko Thursday 14:00-15:30, N11 labs page
Jakub Yaghob #nswi170-compsys-yaghob Tuesday 14:00-15:30, N8 labs page
Filip Zavoral #nswi170-compsys-zavoral Tuesday 14:00-15:30 (even weeks), N11 labs page

Arduino

First order of business: get your own Arduino within the first two weeks! You can either buy it or borrow it in the library at Mala Strana. If you are going to the library for the first time it might be a good idea to register first to speedup the process. There is an online registration form for this purpose.

Library for your Arduino labs: Funshield.zip

ReCodEx uses an Arduino emulator for validation of home assignments. Despite supporting all major features of the real Arduino, there are some differences:

Issue Example Workaround
Unsupported complex initialization of global variables size_t t = millis(); Initialize the variable with a default value and call the complex initialization in the setup() function.
Unsupported communication API Serial.print(); Use the functions for local debugging only.
max is a macro at Arduino but a function in ReCodEx int x; long y; max(x,y); Always use min/max with identical types of arguments.
int/long are 16/32 bits at Arduino but 32/64 in ReCodEx int32_t x; long y; max(x,y); Do not mix int/long with int16_t/int32_t.
Funshield include #include <funshield.h> Replace by #include "funshield.h"
Conservative C++ (order of declarations) int main() { foo(); ...}
void foo() {...}
In C++, you need to declare functions (classes, ...) before you use them.
Static methods class Foo { static void foo() ... } Static methods do not work in ReCodEx, use plain old C functions instead.
Initialization class Button {
Button() { pinMode( b[0], INPUT); }
};
Emulator (Arduino) initilization (e.g., pinMode) MUST be called in setup. Early emulator initialization (e.g., in a constructor of a global object) causes a signal and your program is terminated.
Unsupported type String String stringOne = "Hello String"; Use standard C-strings instead, i.e., const char *stringOne = "Hello String";