0% found this document useful (0 votes)
5 views8 pages

EnrichingComputerScienceProgrammingClasseswithArduinoGameDevelopment (1)

The document discusses an Arduino-based educational board designed to enhance computer science programming classes by enabling students to create interactive games and applications. It highlights the benefits of using Arduino for teaching programming concepts, allowing students to engage with physical devices and gain practical skills. The paper also presents various projects and examples, illustrating how the board can facilitate learning in programming fundamentals and game development.

Uploaded by

achira113456789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views8 pages

EnrichingComputerScienceProgrammingClasseswithArduinoGameDevelopment (1)

The document discusses an Arduino-based educational board designed to enhance computer science programming classes by enabling students to create interactive games and applications. It highlights the benefits of using Arduino for teaching programming concepts, allowing students to engage with physical devices and gain practical skills. The paper also presents various projects and examples, illustrating how the board can facilitate learning in programming fundamentals and game development.

Uploaded by

achira113456789
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

See discussions, stats, and author profiles for this publication at: https://www.researchgate.

net/publication/327006434

Enriching Computer Science Programming Classes with Arduino Game


Development

Conference Paper · July 2018


DOI: 10.1109/HSI.2018.8430994

CITATIONS READS

17 1,077

2 authors:

Piotr Duch Tomasz Jaworski


Lodz University of Technology Lodz University of Technology
30 PUBLICATIONS 152 CITATIONS 36 PUBLICATIONS 479 CITATIONS

SEE PROFILE SEE PROFILE

All content following this page was uploaded by Tomasz Jaworski on 23 January 2019.

The user has requested enhancement of the downloaded file.


Enriching Computer Science Programming Classes
with Arduino Game Development
Piotr Duch Tomasz Jaworski
Institute of Applied Computer Science Institute of Applied Computer Science
Lodz University of Technology, Poland Lodz University of Technology, Poland
Email: [email protected] Email: [email protected]

Abstract—The following article presents an electronic edu- displays, servo motors, etc. They allow for the implementation
cation board based on popular Arduino microcomputer. Its of physical actions observable by the programmer. It is also
purpose is to make programming learning more attractive by possible to connect input devices, such as buttons, light
expanding the possibilities of interaction with a computer with a
number of input/output devices, such as joysticks, graphic and sensors, microphones, compasses, accelerometers, thermome-
alphanumeric displays, light emitting elements, keyboards and ters, etc. This is an interesting extension regarding building
radio communication. Due to its affordable price and availability, window-based interfaces or writing console applications, that
students that do not have any practical skills or knowledge in are visible only on the computer’s screen. Louisiana Tech Uni-
the field of electronics can build simple games and applications versity introduced a small robot based on the Arduino platform
that are beyond their reach in the normal programming course,
during which they usually write console based programs. [17] into its Fundamental of Programming course. Similarly,
Keywords: Arduino, Introductory Programming, Educational mobile robots equipped with Arduino microcomputers are also
Board, Game Development on Arduino used at the Univeristy of Sevilla to conduct robotics classes
[18]. Raspberry Pi supported with Arduino module can also
I. I NTRODUCTION
be successfully used in teaching automation and control [15].
In recent years, there has been a clear and visible tendency
to popularize programming skills. Teachers are trying to make II. M OTIVATION
programming classes more friendly and attractive to students. Last year, the authors of the presented article have started
Such solutions include systems for automatic evaluation of the course of Intelligent Autonomous Systems [19] as a part
student programs, like Marmoset [1], CourseMaster [2], Web- of classes at the Lodz University of Technology (TUL). The
CAT [3], Internet-based Audience Response System [4], web- main goal of this course was to familiarize students with one
based knowledge verification [5], along with other automated of the most important and desirable topic nowadays - building
assessment tools [6]. and programming autonomous mobile vehicles (fig. 1).
Some of those systems introduce a gamified [7]–[9] ap-
proach that allows students to collect achievements [10], very
popular in computer games. Some universities work also on
aspects of gamification as a part of their programming course
[11]–[13]. Students with a high level of independence and
self-learning skills can find online games for programmers,
that can be run in a web browser. A good examples might be
a site like CodeHunt [14]. In order to pass to the next level, a
participant has to write a short piece of code based on a given
assignment.
A completely different approach to make programming
course more attractive is to move away a bit from program-
ming activities in classic PC environments, such as Windows
and Linux. Instead, a programming of microcomputers such
as Intel Galileo [15] or Arduino [16] is introduced.
The low-level nature of these modules allows for a large
spectrum of electronic devices to be easily connected to them, Fig. 1. Vehicles built during Intelligent Autonomous Systems Classes
extending their capabilities in interaction with the user (the
student). However, before students even started programming physi-
These devices can be used as output elements such as mul- cal platforms, they had to learn the basics of programming
ticolored LEDs, sound generators, graphic and alphanumeric on the Arduino, as the computer of choice for controlling
978-1-5386-5024-0/18/$31.00 
c 2018 IEEE

148
autonomous vehicles. For the purposes of these activities, device without the need to understand any low-level details of
we decided to design and implement an Arduino-based ed- the circuits.
ucational board 2. In this project, along with the electronic
modules necessary to work with the autonomous platform, a
number of additional modules were provided. Their purpose
was to make the classes more attractive and fun. The simplicity
of programming the developed board and reactions of students
encouraged us to partially introduce Arduino programming to
the subject of Fundamentals of Programming on the first year
of studies in Computer Science.
A typical programming course consists of a set of topics
divided into coding exercises. In the case of the C language,
they can be practically performed only using the standard
console as the output and a keyboard as the input. In case
of a student for whom this is the first contact with a formal
programming language, it is almost impossible to create more
interesting or complex programs. However, students want to
write more attractive and interesting programs on the first year
of their studies and gain additional valuable skills during such
work.
III. A RDUINO BASED E DUCATIONAL B OARD
Fig. 2. Arduino based Educational Board
The presented electronic educational board is based on the
popular Arduino Due module. Features that have influenced All components were selected in such a way that the cost of
the choice of this device are: its popularity, price and perfor- the entire device was as small as possible and resulted in the
mance. As a part of the Arduino family, the selected board total cost of one module around $110. This approach allowed
has an affordable and easy-to-use programming tool, namely interested students to build their own, simplified clones and
Arduino IDE. Arduinos are used mainly by DIY enthusiasts work individual on their own.
but also by professional programmers and electronic circuit
designers. This results in the availability of a large number IV. F UNDAMENTALS OF P ROGRAMMING C LASSES IN C
of forums where a student can find answers to errors and WITH DEVELOPED EDUCATIONAL BOARD
problems that may occur during his work. The Fundamentals of Programming Course, implemented by
The price compared to the performance is also very attrac- the Institute of Applied Computer Science at TUL, is focused
tive. For about $50 a complete device can be bought, ready on programming in C language. The course lasts for one year
to be connected to any personal computer or a laptop. Only and is divided into two semesters. Each semester consists of
an USB cable is required - no advanced programmer nor 15 weeks during which lectures and laboratories are carried
electronics and programming of microcontrollers experience out. During the first semester students learn the basics of
is needed. the language, such as data types, basic input/output functions,
With the first prototypes, the authors met Computer Science loops, arrays and the most popular sorting algorithms. The in-
students’ bias to the electrical wires connecting elements of telligibility of the designed Arduino educational board allowed
the prototype. Students were afraid of the device due to the for its ”painless” introduction into the existing classes. Due to
possibility of damaging it. Therefore, the final design was in the fact that Arduino is programmed in a mixture of C and
the form of an electronic PCB. As a result, the user has no C++, students only had to pay attention to a slightly different
contact with connection cables to tinker with. This allows to naming and functions, eg. instead of printf they had to use
focus on the code itself as well as increase the lifespan of lcd.print or oled.print. In contrary to the authors’ concerns
the electronics itself. As a result, a student has to connect its the C++ burden did not pose any obstacles for students.
board to a computer and can start coding. The following sections present some possible applications
The prepared educational board (Fig. 2) is equipped with of a designed educational board in teaching C structures.
a number of input and output devices. These are: two two-
axis joysticks, a potentiometer, two keyboards (arrows and A. Conditional Statements
a numerical 4x4 keyboard), a buzzer, an audio amplifier, a Conditional instructions can be used to check if a selected
Bluetooth module, an ultrasonic distance sensor, a socket for button is pressed on the keyboard. Depending on the result,
connecting 4 RC servo motors, 8 LEDs, an OLED display the program can change the lighting state of the corresponding
(128x64), a LED matrix display (8x8), an alphanumeric dis- LED. For a more complex task, the graphic display shown
play (16x2) and a four-digit 7seg display. Each device has a in fig. 3 can be used. Pressing one of the arrow keys can
custom library available [20], hence the student can use the move the displayed object (eg. a rectangle) around the display.

149
In addition, the student must check whether the movement
of the object can be executed - boundary conditions must be
recognized and implemented.

Fig. 4. The results of the student loop code with task to turn on all and then
turn off the entire diode line.

Fig. 3. Controlling the position of an object visible on the OLED display


using the up, down, left and right keys.

In addition, assuming that the object is described by its XY-


location and its size, the necessary conditions are not obvious
to a first-year student. The solution to this problem brings
additional valuable experience.
Fig. 5. A LCD alphanumeric display with 16 columns and 2 rows, that can
B. Loops be considered as an equivalent of a text console.

Loop instructions can be practiced, for example, using a


line of luminescent LEDs. Successively turning them on and E. Input/Output - Keyboards
off and using the delay function, the student can get various, Entering any data with the presented educational platform
interesting lighting effects. Fig. 4 presents a visualization of has been simplified in favor of two keyboards - numeric and
an exemplary program, where the student was asked to switch arrows (fig. 6).
on and off subsequent LEDs to create an animation of moving
light.

C. Arrays
The set of LEDs, shown in fig. 4, can also be controlled
using array expressions. For this purpose the LEDS[] array is
provided in such a way that any attempt to access memory
outside its area will end with the program halt. In turn, to
work with 2D arrays, an 8x8 LED matrix display is perfectly
suited, and can be seen as a table of the same size. In this
case a frequently implemented students’ project involves two
joysticks in an attempt to ”catch” one light point the other.

D. Input/Output - Text Console


Fig. 6. Two keypads: numeric with 16 keys and arrows with 4 keys
The LCD display (Fig. 5) can be used during teaching about
strings and a text console. It can be used to show a simple The arrow keypad is used by students as a simple game
menu that will look more attractive than its operating systems controller, eg. to control a tank or to choose an option from a
console counterpart. In addition, the direct control of the cursor menu. The numeric keyboard allows entering numbers and
and character generator allows the student to understand how arithmetic characters, eg. for building a simple calculator.
important and useful these functionalities are. Arrow keypad is connected directly to Arduino and do not

150
require any special software. The second is a matrix one and meeting get a tutorial, which explains how to work with each
makes students use appropriate API concealing the irrelevant of the elements individually. Thanks to this, students who have
technical details. just started studying programming can prepare interesting and
If student needs to work with strings, the Serial Port Monitor visually attractive projects. Having fun with writing games can
built into the Arduino IDE can be used. It allows to send texts be so addictive that students wanting to solve problems they
to a program running on the board. encounter, browse through available literature and learn topics
reserved for later years, such as finite state machines.
F. Sorting algorithms Below are some examples of projects carried out by
One of the most difficult topics for first-year students are first-year students while testing the presented board. Shown
the sorting algorithms. They often do not understand the need projects are also available as video [21].
or mechanisms of such algorithms. Using the presented edu-
A. Snake
cational board, it is possible to show students the visualization
of different sorting algorithms, eg. using the 8x8 LED matrix
(fig. 7), where columns are sorted, due to their height. It is
also possible to sort light points (fig. 4) due to their brightness.

Fig. 7. Visualization of a sorting algorithm on 8x8 LED matrix display

V. S TUDENTS ’ P ROJECTS
Intensive training for individual programming language
structures, such as conditions or loops, is extremely impor-
tant. However, for the student it may be more interesting to
implement individual projects. Writing even the simplest game
in C is ineffective and the lack of results in a short time is
discouraging. This is due to the fact that C language learning
environments are adapted to writing code and learning about
its formal structures and not for writing games. There are
known and popular libraries aimed at creating games, eg. SDL.
However, working with them is beyond the reach of most first-
year students. Even with the teacher’s help, the amount of a
new things to learn can be a deterrent.
In order to address this problem, the developed educational
board has been equipped with a simplified API, allowing
communication with each of its elements. Students at the first

Fig. 9. Snake: on 8x8 matrix display and OLED graphics display

The Snake game in the 8x8 and 128x64 version is shown


in fig. 9. It is the most commonly implemented game. Student
can use one or several displays to show game’s information.
B. Space Invaders
Space Invaders (fig. 8) is great in teaching arrays. Each
opponent must have his own entry. Similarly with projectiles.
In addition, the number of projectiles on the screen can be
Fig. 8. Space Invaders practically freely changed.

151
C. Tetris and falling objects

Fig. 10. Tetris and Falling Fruits Fig. 11. Pacmanfrogger and Tanks

Working with different shapes can be challenging for stu-


dents. In case of Tetris (fig. 10) the greatest difficulty is to
store and process various shapes, during fall and collision
with previously placed ones. The student learns to describe
an object using its coordinates and size. The knowledge of
2D arrays may come in handy.

D. Pacman and Tanks


Arcade games (fig. 11) like Pacman or Tanks are great for
introducing the concept of multitasking without threads. The
need to animate many objects at the same time and give them
a vestigial intelligence enforces the use of solutions like finite
state machine.

E. Platformers
Platform games are among the most difficult to implement
for students. This is due to the fact that the objects do not
Fig. 12. A simple arcade game
have standardized shapes and location. In addition, they are
designed for different purposes, e.g. platforms, collectibles,
player, opponent, etc.

152
F. Oscilloscope their further work with mix of computer programming and
The presented educational board is not limited to games electronics.
only. Students of other fields such as electronics can use it
as a prototyping platform. An example is the design of an
oscilloscope with an adjustable time base (potentiometer).

a) b)

Fig. 13. Student’s made Oscilloscope

VI. R ESULTS AND S UMMARY


To check students’ reactions to the introduction of the
presented educational board, a pilot classes were carried
out. They consisted of 2 hours of lectures and 2 hours of
practical classes. The lectures discussed the basics of Arduino
programming, the Arduino IDE environment and individual
components on the educational board. After practical classes a
questionnaire was carried out. A 203 first year and 123 second
year Computer Science TUL students took part.
The following three questions were asked in the survey and
each of them could be given a mark from 1 to 5:
1) How would you rate the usefulness of the acquired
knowledge during laboratories as a programmer?
2) Will the ability to program Arduino devices be useful in Fig. 14. The results of the questionnaire for a) first, and b) second year of
implementing your own ideas? studies in the field of Computer Science
3) Would you like to attend programming classes carried
out on the presented educational Arduino boards? According to the authors, introducing development educa-
The overall reaction is general very positive. Most respon- tional board will increase students’ interest in programming
dents answered questions Q1 and Q3 with mark 4 and 5. Due activities and will bring them to hardware issues closer
to the fact that the classes were directed to beginner students than classical classes with lectures and laboratories. This
(fig. 14a), the second year (fig. 14b) answered the Q1 question is extremely important due to the ubiquitous and dynamic
a bit more moderately. This is most likely due to the already development of IoT (Internet of Things) technology, wireless
acquired knowledge of the programming basic. The highest communication and intuitive user interfaces. It will allow
count of 2 and 1 marks was in question Q2. This is due to the students to develop their imagination not only in the field of
fact that for some students Arduino programming was just an computer program design but also to develop awareness in the
interesting deviation from the normal course of classes. Some field of human-machine and machine-machine communication
of them already have a clear career path and do not connect interfaces.

153
ACKNOWLEDGMENT [10] L. de-Marcos, A. Dominguez, J. Saenz-de-Navarrete,
This work was financed by the Lodz University of Technol- and C. Pages, “An empirical study comparing gamifi-
ogy, Faculty of Electrical, Electronic, Computer and Control cation and social networking on e-learning,” Computers
Engineering as a part of statutory activity (project no. 501/12- Education, vol. 75, pp. 82–91, 2014, ISSN: 0360-1315.
24-1-5418) DOI : https://doi.org/10.1016/j.compedu.2014.01.012.
[Online]. Available: http : / / www . sciencedirect . com /
R EFERENCES science/article/pii/S036013151400030X.
[1] J. Spacco, D. Hovemeyer, W. Pugh, J. Hollingsworth, [11] M. Ortiz, K. Chiluiza, and M. Valcke, “Gamification
N. Padua-Perez, and F. Emad, “Experiences with mar- in computer programming: Effects on learning, engage-
moset: Designing and using an advanced submission ment, self-efficacy and intrinsic motivation,” Oct. 2017.
and testing system for programming courses,” in ITiCSE [12] S. Azmi, N. Iahad, and N. Ahmad, “Gamification in
’06: Proc. of 11th annual conference on Innovation and online collaborative learning for programming courses:
technology in computer science education, Bologna, A literature review,” vol. 10, pp. 18 087–18 094, Jan.
Italy, 2006. 2015.
[2] E. Foxley, C. Higgins, P. Symeonidis, and A. Tsintsifas, [13] S. Combéfis, G. BERESNEVIČIUS, and V. Dagienė,
“The coursemaster automated assessment system - a “Learning programming through games and contests:
next generation ceilidh,” Jan. 2001. Overview, characterisation and discussion,” Olympiads
[3] S. H. Edwards and M. A. Perez-Quinones, “Web- in Informatics, vol. 10, no. 1, pp. 39–60, 2016.
cat: Automatically grading programming assignments,” [14] N. Tillmann, J. de Halleux, T. Xie, and J. Bishop, “Code
SIGCSE Bull., vol. 40, no. 3, pp. 328–328, Jun. 2008, hunt: Gamifying teaching and learning of computer
ISSN : 0097-8418. DOI : 10.1145/1597849.1384371. science at scale,” in Proceedings of the First ACM
[4] L. Jackowska-Strumillo, J. Nowakowski, P. Strumillo, Conference on Learning @ Scale Conference, ser. L@S
and P. Tomczak, “Interactive question based learning ’14, Atlanta, Georgia, USA: ACM, 2014, pp. 221–222,
methodology and clickers: Fundamentals of computer ISBN : 978-1-4503-2669-8. DOI : 10 . 1145 / 2556325 .
science course case study,” in Proc. 6th International 2567870. [Online]. Available: http://doi.acm.org/10.
Conference on Human System Interactions (HSI), Jun. 1145/2556325.2567870.
2013, pp. 439–442. DOI: 10.1109/HSI.2013.6577862. [15] D. Assaf, “Enabling rapid prototyping in k-12 engi-
[5] L. Jackowska-Strumillo, W. Bieniecki, and M. B. Saad, neering education with botspeak, a universal robotics
“A web system for assessment of students’ knowledge,” programming language,” 2014.
in Proc. 8th International Conference on Human System [16] M. Rubio, R. Romero-Zaliz, C. Manoso, and A.
Interaction (HSI), Jun. 2015, pp. 20–26. DOI: 10.1109/ De Madrid, “Enhancing an introductory programming
HSI.2015.7170638. course with physical computing modules,” vol. 2015,
[6] S. Stolinski, W. Bieniecki, and M. Stasiak-Bieniecka, Feb. 2015.
“Computer aided assessment of linear and quadratic [17] G. W. Recktenwald and D. E. Hall, “Using arduino as
function graphs using least-squares fitting,” in 2014 a platform for programming, design, and measurement
Federated Conference on Computer Science and Infor- in a freshman engineering course,” in Proceedings of
mation Systems, 2014, pp. 651–658. DOI: 10 . 15439 / the American Society for Engineering Education Annual
2014F365. Conference & Exposition, 2011.
[7] G. Polito and M. Temperini, “A gamified approach to [18] F. M. Lopez-Rodriguez and F. Cuesta, “Andruino-a1:
automated assessment of programming assignments,” in Low-cost educational mobile robot based on android
Challenges and Solutions in Smart Learning, M. Chang, and arduino,” vol. 81, May 2015.
E. Popescu, Kinshuk, N.-S. Chen, M. Jemni, R. Huang, [19] (2018). Intelligent autonomous systems materials home-
and J. M. Spector, Eds., Singapore: Springer Singapore, page, [Online]. Available: http://isa.iis.p.lodz.pl/ (visited
2018, pp. 3–12, ISBN: 978-981-10-8743-1. on 03/10/2018).
[8] F. Layth Khaleel, N. Ashaari, T. Wook, T. S. M. T. W. [20] T. Jaworski and P. Duch. (2018). Firmware for ar-
Tengku Wook, and A. Ismail, “The study of gamifica- duino educational board, [Online]. Available: https :
tion application architecture for programming language / / github . com / InteligentneSystemyAutonomiczneIIS /
course,” Jan. 2015. ISAFirmware (visited on 03/10/2018).
[9] J. Paiva, J. Leal, and R. Queiros, “Design and imple- [21] P. Duch and T. Jaworski. (2018). Fundamentals of
mentation of an ide for learning programming languages programmings - student’s projects, [Online]. Available:
using a gamification service,” in Gamification-Based E- http : / / pp . iis . p . lodz . pl / doku . php ? id = public : projekty
Learning Strategies for Computer Programming Edu- (visited on 03/10/2018).
cation. Jan. 2017.

154

View publication stats

You might also like