SlideShare ist ein Scribd-Unternehmen logo
1 von 81
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
Robotics-Based
Learning in the Context
of Computer
Programming
Is it more effective to teach programming via
interaction with a computer simulation or via
robotics-based learning?
Jacob Edward Storer
12/05/2016
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
Contents
Abstract ..........................................................................................................................1
Introduction....................................................................................................................2
Objectives and Deliverables...........................................................................................3
Objectives...................................................................................................................3
Deliverables................................................................................................................3
Design Decisions............................................................................................................4
Tutorial Design...........................................................................................................4
Programming Tasks....................................................................................................7
Implementation ..............................................................................................................9
The Tutorials ..............................................................................................................9
Arduino Programming..............................................................................................10
Simulation Programming .........................................................................................12
Project Management ....................................................................................................14
Change Control & Change Management .................................................................14
Testing..........................................................................................................................15
Test Plan - Tutorial Applications .............................................................................15
Test Results - Tutorial Applications.........................................................................16
Test Plan - Arduino Program ...................................................................................17
Test Results - Arduino Program...............................................................................18
Test Plan - Visual Basic Simulation Program..........................................................19
Test Results - Visual Basic Simulation Program .....................................................19
The Primary Research Process.....................................................................................21
Research Plan...........................................................................................................21
Quantitative Results .................................................................................................22
Qualitative Results ...................................................................................................25
Other Comments ......................................................................................................26
Results Analysis .......................................................................................................27
Conclusion ...................................................................................................................29
Future Developments ...............................................................................................29
Personal Evaluation......................................................................................................30
References....................................................................................................................31
Appendix......................................................................................................................32
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
Appendix A: Complete Arduino Exercise Source Code ..........................................32
Appendix B: Complete Simulation Exercise Source Code – C++ & SDL..............36
Appendix C: Complete Simulation Exercise Source Code – VB ............................38
Appendix D: Arduino and Simulation Tutorial Source Code..................................39
Appendix E: Tutorial Contents ................................................................................56
Appendix F: Project Program SurveyTemplate .......................................................63
Appendix G: Completed Project Surveys ................................................................66
Appendix H: Project Sponsorship Agreement Form................................................78
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
1
Abstract
This final report includes an insight into the course of development, including
objectives, design decisions, implementation processes, the research process itself,
and a no throughout the primary research project, which was conducted in order to
answer:
“Is it more effective to teach programming via interaction with a computer simulation,
or via robotics-based learning?”
In an attempt to answer this, a robotics-based medium, utilizing an Arduino robot, and
a simulation-based medium, utilizing a Visual Basic windows application, were
constructed, and a test group was acquired, which were provided with a survey upon
completion of the proposed tasks for each medium. Primary data collected through
these surveys indicated a great diversity in the opinions of which medium is more
effective, though all test subjects indicated a distinct improvement in learning with the
presence of a qualified teacher. However, due to the small sample size of test users,
no conclusive answer could be provided for the question above.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
2
Introduction
With recent UK government-driven efforts in reinforcing the importance of teaching
programming to children, research into effective teaching of the field, has rapidly
become critical. As a result of this, determining which teaching methods will be most
successful at supplying students with robust knowledge is a crucial task. As
educational curriculums are becoming increasingly supported by, and dependent
upon, computer-based learning, considerations of implementing a wider range of
computing applications have grown in popularity. Robotics is one such field, as robots
are becoming increasingly useful, in a greater variety of industries, with the abilities
of such machines developing and improving over time.
Initial research, conducted in the preliminary literature review, revealed that ‘robots
have great potential for sound pedagogic reasons within education at all levels’
(Cooper et al. 1999), which enforces the importance of developing methods of
fulfilling such potential. However, in order to determine whether this is a worthwhile
venture, it must first be determined whether the educational potential of robots is
greater than present computer-based learning mediums. Commentary by Dave Catlin
and Mike Blamires (2012) states that ‘while teachers share this intuitive view (of
physical robots having positive interactions with students), there is little hard data to
verify the claim.’ Thus, the aim of this project is to collect and exhibit primary data
that either verifies, refutes, or provides additional discussion around the
aforementioned claim.
This work-based research project has been conducted in order to provide a reasoned
answer to the following, initial, research question, as outlined in the initial action
plan:
“Is it more effective to teach programming via traditional teaching methods or via
computer and robotics-based learning?”
However, this question has evolved throughout the design phase of the project’s
development, as it was deemed unfit for the project’s now decided course. The
primary research question is now as follows:
“Is it more effective to teach programming via interaction with a computer simulation,
or via robotics-based learning?”
This developed question now provides an appropriate description of the purpose of
the project, and helps to provide a more accurate query, as both research directions
will employ computer-based learning, for its ease of distribution and accessibility.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
3
Objectives and Deliverables
As no official client was secured, or intended to be, though there is a sponsor for the
project who agreed to supply necessary resources, a set of primary objectives and
definitive deliverables were self-constructed, as opposed to carrying out the typical
process of a requirements capture from a client. These objectives and deliverables
were determined as part of the initial project action plan, and are as follows:
Objectives
1. Become more familiar with the programming of the Arduino robot.
2. Become more familiar with programming movable sprites in C++.
3. Develop an application to facilitate a simulation, as well as provide a tutorial
into programming within Visual Studio.
4. Develop an application that provides a tutorial for the programming of the
robot within the Arduino software.
5. Conduct research on two separate test groups, in order to determine the
effectiveness of both methods, so that they can be compared.
6. Construct appropriate documentation to contain all development, findings and
analysis.
Deliverables
 An application which facilitates the simulation of a moving sprite, while
providing tutorial for how to program its movement.
 An application that provides tutorial for the programming of the Arduino
robot.
 A detailed project report, containing all findings and analysis, as well as
details of project management, design decisions and a final review of the
project’s requirements.
(Storer, 2016)
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
4
Design Decisions
This section of the report contains a reflective view on the design decisions made
throughout the course of development, covering how the finally implemented designs
effectively meet the previously defined objectives of the project.
Tutorial Design
For tutorials to be effective, they need to be clear and comprehensive in relevant
areas. While the original objectives were vague as to how much content each tutorial
should offer, too much detail provided in irrelevant areas can cause learners to
become confused or overwhelmed. The reduction of possible confusion and resulting
irritation was a key factor in the design of the two tutorial programs, which would be
accomplished by applying effective human-computer interaction principles, to
emphasize or make important information clear, while ensuring that no unnecessary
information was displayed.
Firstly, it was decided that the framework and functionality could be consistent across
both tutorials, which provides benefit to users who may be tested with both
applications. This consistent framework and functionality also significantly reduced
development times for the two tutorials, as two copies of one template could be
created and populated with differing information.
Before development, it was pre-determined that using the Visual Basic programming
language, through Visual Studio 2010, would provide satisfactory design and
functionality options. With personal experience in Visual Basic and the availability of
Visual Studio 2010 both at home and within Bath College, this seemed like a natural
choice.
It was also decided that, as part of reducing the chance of users becoming confused,
each tutorial application would be divided into five separate tutorials, which would
appropriately organize separate tasks or ‘milestones’ in the learning of each medium.
To navigate between these sections, it was decided that a main switchboard should be
available as a portal to each tutorial ‘chapter’, while also providing the facility for
users to neatly close the program. A screenshot of this main menu, from the Arduino
tutorial variant, is shown below:
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
5
Image: Arduino Robot Tutorial Program – Main Switchboard
The above screenshot has been taken from the final version of the tutorial for the
Arduino robot, and demonstrates the clarity of the each button, which are clearly
labelled for each tutorial, while also showing how separated the ‘Exit’ button is, to
prevent accidental closing of the application. Additionally, it was decided that two
menu strip items should be included, for easier navigation. Under the ‘File’ menu, two
options are provided for either returning to the main menu, or for exiting the program,
while the ‘Tutorials’ menu item allows for an alternative method of navigation, from
which any of the five tutorials can be navigated to. The following screenshot shows
similar design considerations, and was taken from the final implementation of the
Arduino tutorial:
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
6
Image: Arduino Robot Tutorial Program – Tutorial 1
The screenshot above captures the design for each tutorial segment, which displays a
large, clear area for the actual tutorial contents, with additional navigation options of
buttons that allow users to navigate to the next, or previous tutorial, which are
disabled on the last and first tutorial section respectively, as well as allowing the user
to return to the main menu. Additionally, text links have been added to the left hand
side, in case users wish to navigate to a specific tutorial. It was decided that creating
these with the typical hyperlink-style design would be effective, and would be
consistent with the users’ present understanding of text-based links.
The content of these tutorials was determined after the construction of both the
Arduino robot program and the simulation, as the exercises that would be provided to
learners would depend greatly on how simple particular sprite, or robot, movement-
based tasks could be implemented and taught. The implemented tutorial reflects the
programming tasks described in the following section.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
7
Programming Tasks
For an effective comparison between the two proposed learning mediums, it was
determined that the tasks which the research group would have to learn and complete
would have to be largely similar. It was also deemed to be important that these tasks
should be terse and easily separable, so that they can be taught effectively in a
segmented style of tutorial.
As the Arduino robot’s primary functionality lies in its mobility, it became apparent
that the best method of comparison would be to develop an application which focuses
on a simulated sprite’s capability of movement. During the initial ‘trying out’ session
of the Arduino robot, it was discovered that it could be programmed fairly simply to
travel forwards and backwards, and perform turning exercises when applying
different speeds to each of the two motors. This clear functionality of the Arduino
robot lent itself to being programmed to move along a set ‘path’, as in pre-
determining a shape or pattern for its movement. From this, it was decided that the
Arduino robot could be programmed for a number of separate tasks, these finally
being:
 Moving forwards and backwards.
 Moving along a square-shaped perimeter.
 Moving along a triangle-shaped perimeter.
 Performing a complete circle of movement.
The above four tasks suited the project well, as they were all fairly simple to program
and showed a clear different outcome for each of them. Additionally, these four tasks
could also be separately neatly into five tutorial segments, including an introductory
tutorial to the Arduino’s functionality in general. As the Arduino robot was
programmed with its own software, with no interface between it and the robot
hardware, no design considerations were necessary for the code to be communicated
to the robot, aside from ensuring that it was separated appropriately and easily
readable.
It was also initially determined that the simulation should provide a sprite capable of
moving along similar, if not the same, patterns. This, truthfully, would have been
ideal, but for reasons explained in the following ‘Implementation’ section, this could
not be accomplished in the development timeframe. In terms of the design of the
simulation, it was decided that it should be kept very simple, by just displaying the
sprite, which would stand out clearly from the background, and the containing
window itself. The screenshot below shows the fairly crude, yet clear, sprite that
would be the focal point of the programming in the simulation:
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
8
Image: Visual Basic Simulation Program
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
9
Implementation
The Tutorials
The two tutorial programs, as mentioned in the previous ‘Design’ section, were both
developed in Visual Studio 2010, in the Visual Basic language, with the primary goal
of providing a concise learning guide for users who have no, or a basic, understanding
of programming. For effective and clear development, all interactive items within the
programs were assigned with appropriate and descriptive names, such as
‘btnTutorialOne’ for the button that navigates the user to the first tutorial, and
‘FileToolStripMenuItem’ for the drop-down menu titled as ‘File’.
As also mentioned in the ‘Design’ portion of this report, each tutorial program was to
offer its information in a divided, or segmented, style, so as to not intimidate or
confuse users with too much information at once. This was accomplished by
developing a windows application with six separate windows, one for the main
switchboard and the rest for the five tutorial segments, which were all ‘hidden’ on
start-up, save for the main switchboard.
On the main switchboard, six clear buttons were created and organized vertically,
which offer users the ability to exit the program, by using a simple ‘Me.Close()’
command, or navigate to any given tutorial by ‘hiding’ the current window and
‘showing’ the requested one. As the program was designed to only allow for the
display of one window at a time, this method of hiding and showing whichever
window was currently visible proved an effective method of showing the user only
what they had requested at a given time, and was consistently used throughout both
tutorial programs, as both share the same framework and functionality. For example,
the ‘Next’ and ‘Previous’ buttons simply hide the current window and show the next
or previous tutorial windows in the sequence. Additionally, this method is used within
the second of the two menu strip items, which provides the users with an alternative
method of navigation. The first menu strip item, labelled as ‘File’, offers only an
‘Exit’ option, but additional options could be added in the future, such as help files or
a user guide, if the tutorial program was to be expanded.
To display the content of each tutorial, rich text boxes were implemented in order to
accommodate large portions of text, which could be sufficiently formatted.
Formatting in tutorials is important, particularly in the case of programming, as all
coding needs to be made distinct and easily visible. To enhance the visibility of the
core content of each tutorial chapter, the default font size of 8 was increased to 10,
which, when tested on both 1920x1080 and 1280x1024 resolution monitors, was felt
to be an appropriate size.
The population of the two tutorial programs occurred after the completion of both the
Arduino and simulation programs, as it was deemed wise to wait until the content of
the tutorials were assured, as if the tutorials were written before the evaluative code
could be tested, then valuable development time could have been wasted. However,
upon completion of the two primary applications, the population of the tutorials was
fairly simple, and was accomplished by right-clicking on the rich text box of each
tutorial chapter and inputting the pre-written tutorial text.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
10
The complete source code for both tutorials can be found in Appendix D.
Arduino Programming
Image: ‘Makeblock Robot Starter Kit’ including the Arduino circuit board.
The Arduino robot is programmed in a variant of C++, with its own custom libraries
of code syntax, through its partner software package, which provides users with the
facilities that allow them to write, verify and upload code to the Arduino circuit-
board, via a Micro-USB to USB cable.
In the case of this project, a ‘Makeblock Robot Starter Kit’, pictured above, was
utilized, which provided an assortment of components that are connected to an
Arduino robot circuit board, including an ultrasonic ranger sensor, an infra-red remote
controller and receiver, and two-wheel drive functionality with a left and right motor.
Out of the features listed above only the infra-red controller, infra-red sensor and
motors were utilized in order to carry out the four aforementioned tasks:
 Moving forwards and backwards.
 Moving along a square-shaped perimeter.
 Moving along a triangle-shaped perimeter.
 Performing a complete circle of movement.
The above tasks were programmed largely by applying pre-determined speed values
to each of the motors, depending on the desired movement. In the case of moving
forward, a positive fixed speed was applied to both motors at once, whereas in the
case of moving backwards, a negative fixed speed was applied. This was utilized in
the ‘ForwardAndBackwards’ function shown below:
void ForwardAndBackFunction()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
11
{
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(-moveSpeed);
MotorR.run(-moveSpeed);
delay(1000);
}
A delay of 1000 milliseconds was applied at the end of each command so that the
‘moveSpeed’ value being applied to each motor could occur for one whole second at a
time, before allowing the program to proceed with the next instruction.
For the three further tasks, the specified shaped perimeters would require the Arduino
robot to turn in order to travel along the desired ‘path’. This was accomplished by
applied different speed values to each motor, with the lower value indicating the
direction the robot will turn. For example, if the robot was to turn right, then the
greater speed would be applied to the left motor, to swing that side of the robot
around. To accomplish all of the remaining tasks, the Arduino robot was required to
turn by, or by multiplications of, 45 degrees. Through trial and error, it was
determined that, at a ‘moveSpeed’ value of 78, a delay of 650 milliseconds was
roughly correct. Unfortunately the accuracy of this speed and delay pairing differs
greatly depending on the slope of the flooring beneath the robot, though these values
were accurate enough to conduct primary research with.
To program the Arduino robot to travel along a square-shaped perimeter, a ‘while’
loop was created, which would move the robot forward for one second, turn it by 90
degrees, and increment a loop counter, initially set at 0, until the loop counter reached
4. This would cause the function to end, and allow the robot to be ready for another
function. To travel along a triangle-shaped perimeter, the robot would have to turn by
45 degrees, move forward, turn 90 degrees, move forward again, turn 135 degrees,
and move forward a final time. Unfortunately, this could not be looped efficiently, so
a simple sequence of instructions was implemented. Lastly, for the circular
movement, two different, positive movement speeds were applied to the two motors,
one being set to travel at a speed of 10, while the other moved at the regular speed of
78. As one motor was able to travel faster than the other, it was then possible for the
Arduino to turn. A large delay of 5500 milliseconds was applied, after testing, to
ensure that the robot would travel in a full circle.
To allow for interaction with the robot via the infra-red (IR) controller, a series of
case statements were constructed near the start of the program, so that when a
particular button of the infra-red controller was pressed, a corresponding function
would be called. For example, in the following segment of code, the function that
moves the Arduino along a square-like path is called when the user pressed the ‘2’
button on the controller:
case IR_BUTTON_2:
SquareFunction();
break;
The complete Arduino robot code can be found in Appendix A.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
12
Simulation Programming
Initial research into how to accomplish the previously decided tasks in C++ concluded
that the most effective way of programming image-based sprites would be to employ
‘Simple DirectMedia Layer’ (SDL), a ‘cross-platform development library designed
to provide low level access to audio, keyboard, mouse, joystick, and graphics
hardware via OpenGL and Direct3D.’ (SDL, 2016). This would provide access to
necessary window creation and image rendering functionality, which could be used to
display a sprite as a surface layer graphic, which could then be programmed with pre-
determined movement.
In order to setup SDL, specifically SDL 2.0, to the point of it being usable in Visual
Studio 2010, numerous changes were required to the properties of the existing C++
project. The provided dependant SDL libraries had to be specifically included as
approved directories for the project, in order to allow access to the necessary syntax.
As a complete beginner to SDL, online sources were researched in order to acquire an
effective basis for the simulator program. An appropriate keyboard-based sprite
movement program in SDL 2.0 was discovered on Programmer’s Ranch (D'Agostino,
2014), a programming blog which offers C++ tutorials. This particular source of code
demonstrated the creation of the window, loading a sprite, setting the background
colour of the window, keyboard input events, which moved the sprite, and the
refreshing of the window to re-render the sprite if its location changes. This code was
edited so that it instead provided a window of an 800x600 resolution, with a black
background to help accentuate the developed star-shaped sprite, as well as move the
sprite by a set amount of pixels in a given direction when a key on the keyboard is
pressed, as opposed to continuously incrementing the amount of pixels for as long as
the key is held down for (See Appendix B).
Unfortunately, this was the extent of the progress made with using C++ and SDL, as
any further development would have required a significant dedication of time, which
simply was not available, because of this, it was decided that a switch to Visual Basic
should be made, in order to build a more satisfactory program in the remaining time.
Prior experience with Visual Basic provided confidence in programming a sprite-
based simulation, as previous projects included using a timer-based system to move
sprites according to a tick of a timer.
A Visual Basic windows application was developed in Visual Studio 2010, utilizing
three primary components, consisting of a timer, a picture box, and the main window
itself. The main window was created to contain the picture box, which would display
the star sprite, and the timer was set to tick every 100 milliseconds. Due to this switch
in implementation method, most of the original set of tasks to be carried out by both
mediums had to be changed in the case of the simulation, as the final version of the
simulation only allows for three tasks, which exclude tasks of programming the sprite
to move in a triangular or circular shape, as the pixel grid-based nature of windows
applications limited this, and it would not be a simple task to teach in a short tutorial.
These tasks are as follows:
 Moving the sprite by a set amount of pixels upwards when clicked on.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
13
 Moving the sprite repeatedly up and down upon running the simulation.
 Moving the sprite along a square-like perimeter.
To accomplish the first task of the above list, a simple sub-routine that subtracts 50
pixels from the distance between the top of the window and the star sprite, when
clicked on, was sufficient. The later tasks required the use of a ‘Time’ integer, which
would increase in value with every tick of the timer component on the primary
window. With each tick of the timer, so every 100 milliseconds, 10 would be added to
the current value stored in the ‘Time’ integer. In the case of the square path task, as
long as the time integer was less than or equal to 20, 50 pixels would be added to the
distance between the left side of the window and the sprite, thereby moving the sprite
right. When the ‘Time’ integer stored a value between 20 and 40, the sprite would
move down. This same practice was used to move the sprite along the two remaining
sides, as well.
The full source code for the Visual Basic simulation program can be found in
Appendix C.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
14
Project Management
Most project management processes were applied as part of the preliminary
documentation supplied before the project could be wholly conducted, within the
action plan. These processes included a risk assessment, an identification of necessary
resources, as well as a project plan, constructed as a Gantt chart.
Change Control & Change Management
As this project was undertaken without requirements determined by a given client,
traditional processes of change control and change management, in relation to a
change in the client’s requirements, were not necessary. However, there were some
significant unforeseen changes to the project’s developmental course, particularly
during the development of the simulation, as described previously. When it became
apparent that a switch to Visual Basic would be more effective than pursuing and
devoting a significant portion of valuable time to learning advanced C++ and SDL
coding. Upon this decision, the solution had to be redesigned, and a consideration for
the tasks that the new simulation was to be able to complete was required. Due to the
shortage of development time remaining, by this point, it was determined that the
simulation should be able to accomplish three separate tasks, as described previously.
Once these tasks were determined, with a consideration for the appearance of the
windows application, the implementation process could be continued until
completion.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
15
Testing
In order to ensure that no functional faults make an impact during the primary
research process, thorough test plans are needed for each application, where were
conducted after the implementation phase of the project. Six tables, three for the test
plans with expected results and another three for a description of the actual test
results, with as well as actions taken, have been listed below.
Test Plan - Tutorial Applications
Element to be Tested Method of Testing Expected Results
Main switchboard
navigation buttons for each
tutorial chapter
Clicking each button to
ensure that the user will
arrive at the expected
location.
Clicking on each
navigation button will
navigate the user to its
appropriately labelled
tutorial chapter.
Main switchboard ‘Exit’
button
Clicking the ‘Exit’ button
to see if the program
completely closes.
Clicking on the ‘Exit’
button of the main
switchboard will close the
program entirely, as
opposed to just hiding the
present window.
‘File’ menu ‘Exit’ option Clicking the ‘Exit’ option
to see if the program
completely closes.
Clicking on the ‘File’
menu ‘Exit’ option will
close the program entirely.
‘Tutorials’ menu item Clicking through each
‘Tutorials’ menu item, to
ensure that the user will
arrive at the expected
location.
Clicking on each item of
the ‘Tutorials’ drop-down
menu will navigate the
user to the appropriately
labelled tutorial number.
Text-based navigation
links for the five tutorial
chapters
Clicking through each
text-link, to ensure that the
user will arrive at the
expected tutorial.
Clicking on each text-
based navigation link will
navigate the user to the
appropriately labelled
tutorial number.
‘Next’ and ‘Previous’
buttons
The ‘Next’ and ‘Previous’
buttons will be clicked
through to ensure that the
user will arrive at the
correct tutorial. These
buttons should also be
disabled at the last and
first tutorial entry,
respectively, which will be
tested by checking their
appearance and by
attempting to click on
them.
Clicking on the ‘Next’ and
‘Previous’ buttons will
navigate the user to the
next or previous tutorial in
the sequence.
Additionally, these buttons
will be greyed out and
disabled on tutorials 1 and
5 respectively.
‘File’ menu ‘Main Menu’ Clicking the ‘Main Menu’ Clicking on the ‘Main
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
16
option option under the ‘File’
menu, to ensure that the
user will be navigated
back to the main menu.
Menu’ option under the
‘File’ drop-down menu
should navigate the user
back to the main
switchboard. Additionally,
this option should not be
displayed on the ‘File’
menu of the main
switchboard.
Tutorial contents to
display
The contents will be
examined to ensure that
the correct tutorial is being
displayed for the correct
tutorial number and title.
Each tutorial will display
the appropriate contents
for the present tutorial. For
example, the first tutorial
option should contain the
introduction to the
Arduino robot, or the
simulation, depending on
the tutorial.
Test Results - Tutorial Applications
Element Tested Method of Testing
Used
Actual Results Actions Taken
Main switchboard
navigation buttons
for each tutorial
chapter
Clicking each
button to ensure that
the user will arrive
at the expected
location.
As expected. None needed.
Main switchboard
‘Exit’ button
Clicking the ‘Exit’
button to see if the
program completely
closes.
As expected. None needed.
‘File’ menu ‘Exit’
option
Clicking the ‘Exit’
option to see if the
program completely
closes.
As expected. None needed.
‘Tutorials’ menu
item
Clicking through
each ‘Tutorials’
menu item, to
ensure that the user
will arrive at the
expected location.
As expected. None needed.
Text-based
navigation links for
the five tutorial
chapters
Clicking through
each text-link, to
ensure that the user
will arrive at the
expected tutorial.
As expected. None needed.
‘Next’ and The ‘Next’ and As expected. None needed.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
17
‘Previous’ buttons ‘Previous’ buttons
will be clicked
through to ensure
that the user will
arrive at the correct
tutorial. These
buttons should also
be disabled at the
last and first tutorial
entry, respectively,
which will be tested
by checking their
appearance and by
attempting to click
on them.
‘File’ menu ‘Main
Menu’ option
Clicking the ‘Main
Menu’ option under
the ‘File’ menu, to
ensure that the user
will be navigated
back to the main
menu.
As expected. None needed.
Tutorial contents to
display
The contents will be
examined to ensure
that the correct
tutorial is being
displayed for the
correct tutorial
number and title.
As expected. None needed.
Test Plan - Arduino Program
Element to be Tested Method of Testing Expected Results
Function which moves the
Arduino robot forwards
and backwards when the
‘1’ button is pressed on the
IR controller.
Pressing the ‘1’ button on
the controller to see if the
function is executed
correctly.
The Arduino robot will
move forwards for one
second, stop, and then
reverse for an additional
section.
Function which moves the
Arduino robot along a
square-shaped path when
the ‘2’ button is pressed on
the IR controller.
Pressing the ‘2’ button on
the controller to see if the
function is executed
correctly.
The Arduino robot will
move forwards for one
second, turn clockwise by
90 degrees, and then repeat
these two actions an
additional three times, to
return itself to its starting
position.
Function which moves the
Arduino robot along a
Pressing the ‘3’ button on
the controller to see if the
The Arduino will turn 45
degrees clockwise, move
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
18
triangle-shaped path when
the ‘3’ button is pressed on
the IR controller.
function is executed
correctly.
forward for a second, turn
90 degrees, move forward,
turn 135 degrees and then
move forward a final time,
to return to its starting
position.
Function which moves the
Arduino robot in a full
circle when the ‘4’ button
is pressed on the IR
controller.
Pressing the ‘4’ button on
the controller to see if the
function is executed
correctly.
The Arduino robot’s left
motor will run at a faster
speed than its right, and
will turn a full 360
degrees.
Test Results - Arduino Program
Element Tested Method of Testing
Used
Actual Results Actions Taken
Function which
moves the Arduino
robot forwards and
backwards when the
‘1’ button is pressed
on the IR controller.
Pressing the ‘1’
button on the
controller to see if
the function is
executed correctly.
As expected. None needed.
Function which
moves the Arduino
robot along a
square-shaped path
when the ‘2’ button
is pressed on the IR
controller.
Pressing the ‘2’
button on the
controller to see if
the function is
executed correctly.
As expected. None needed.
Function which
moves the Arduino
robot along a
triangle-shaped path
when the ‘3’ button
is pressed on the IR
controller.
Pressing the ‘3’
button on the
controller to see if
the function is
executed correctly.
As expected. None needed.
Function which
moves the Arduino
robot in a full circle
when the ‘4’ button
is pressed on the IR
controller.
Pressing the ‘4’
button on the
controller to see if
the function is
executed correctly.
The robot only
travelled for about
half of the circle.
The delay value
was increased, to
extend the
amount of time
that the speed
values would be
applied to each
motor. This value
was increased
from 2600 to
5500, which
proved
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
19
appropriate.
Test Plan - Visual Basic Simulation Program
Element to be Tested Method of Testing Expected Results
Task which moves the
sprite by a set amount of
pixels upwards when
clicked on.
Running the program in
debug mode and clicking
on the star sprite, to see if
it moves by the determined
amount of pixels.
When the program is
started, if all other tasks
have been commented out
or have been removed, the
sprite, when clicked on,
will move 50 pixels
upwards.
Task which moves the
sprite repeatedly up and
down upon running the
simulation.
Running the program in
debug mode and seeing
whether the sprite
repeatedly moves up and
down until the program is
closed.
When the program is
started, if the square-
perimeter task is not
enabled, the sprite will
immediately and
repeatedly move
downwards and then
upwards.
Task which moves the
sprite along a square-like
perimeter.
Running the program in
debug mode and seeing
whether the sprite
repeatedly moves in a
‘clockwise’ square until
the program is closed.
When the program is
started, if the ‘up and
down’ task is disabled, the
sprite will immediately
and repeatedly move along
a square-shaped perimeter,
beginning with moving to
the right, and then down.
Test Results - Visual Basic Simulation Program
Element Tested Method of Testing
Used
Actual Results Actions Taken
Task which moves
the sprite by a set
amount of pixels
upwards when
clicked on.
Running the
program in debug
mode and clicking
on the star sprite, to
see if it moves by
the determined
amount of pixels.
As expected. None needed.
Task which moves
the sprite repeatedly
up and down upon
running the
simulation.
Running the
program in debug
mode and seeing
whether the sprite
repeatedly moves
up and down until
the program is
As expected. None needed.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
20
closed.
Task which moves
the sprite along a
square-like
perimeter.
Running the
program in debug
mode and seeing
whether the sprite
repeatedly moves in
a ‘clockwise’ square
until the program is
closed.
As expected. None needed.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
21
The Primary ResearchProcess
Research Plan
In order to ensure that the research conducted is effective and completed in a timely
manner, several key elements of the research process were pre-determined.
By the time of completion of the implementation and testing phases of the project, the
opportunity of conducting the project research on a large group of subjects had
passed, and only a small sample size of computing students could be guaranteed for
participation. Because of this, it was decided that each student should test through
both the Arduino robot and Visual Basic simulation exercises.
In terms of how the data would be collected, it was decided that primary data
collection would be best done through survey documents that the research subjects
would be encouraged to complete after they had completed the tasks set by the two
tutorials. Each survey document requested basic information about the user, such as
age, gender and occupation, so that it would be possible to analyse other correlations
across the data.
In terms of quantitatively evaluable questions, the following questions were presented
as the first part of each survey, which could be answered with either: ‘Not effective at
all’, ‘Not very effective’, ‘Somewhat effective’, ‘Effective’, or ‘Very effective’.
Simulation-Based Program:
1. Do you feel that the simulation was an effective medium for learning basic
programming?
2. How effective do you think the simulation would be in teaching you
programming without the aid of a human teacher?
3. How effective would the addition of a human teacher be when learning
through this medium?
Robotics-Based Program:
1. Do you feel that the Arduino robot was an effective medium for learning basic
programming?
2. How effective do you think the Arduino robot would be in teaching you
programming without the aid of a human teacher?
3. How effective would the addition of a human teacher be when learning
through this medium?
In terms of qualitatively evaluable questions, the following questions were presented
as the later part of each survey:
1. Which aspects did you particularly like from either medium?
2. Which aspects did you particularly dislike from either medium?
3. What suggestions would you make to improve either medium?
4. Which medium would you personally prefer to use for learning programming?
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
22
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
1. Do you feel that the simulation was an effective medium for learning basic
programming?
Effectiveness of the Simulation
Number of Responses
5. Which medium would you recommend to beginner programmers, provided
that both were available to them?
An ‘Other Comments’ section was also provided at the end of each survey, in case
any users had additional points that they would like to raise, which couldn’t be used in
response to any of the above questions.
The survey template can be found in Appendix F, while the completed surveys of the
acquired research subjects can be found in Appendix G.
Quantitative Results
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
23
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
2. How effective do you think the simulation would be in teaching you
programming without the aid of a human teacher?
Effectiveness of the Simulation without a
Human Teacher
Number of Responses
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
3. How effective would the addition of a human teacher be when learning
through this medium?
Effectiveness of the Simulation with a Human
Teacher
Number of Responses
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
24
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
2. How effective do you think the Arduino robot would be in teaching you
programming without the aid of a human teacher?
Effectiveness of the ArduinoRobot without a
Human Teacher
Number of Responses
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
1. Do you feel that the Arduino robot was an effective medium for learning
basic programming?
Effectiveness of the ArduinoRobot
Number of Responses
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
25
0
1
2
3
4
5
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
3. How effective would the addition of a human teacher be when learning
through this medium?
Effectiveness of the ArduinoRobot with a
Human Teacher
Number of Responses
Qualitative Results
Question Response(s)
Which aspects did you particularly like
from either medium?
 It’s easy to see whether you’ve
programmed it correctly or not,
since the movement of the items
provides feedback.
 Was able to relate to the robot
with prior knowledge about wheel
speeds in order to determine
direction
 They were both visual so students
can see results easily.
 With the simulation piece it was
very accessible from point of
view that testing was very quick
as opposed to plugging in the
robot.
Which aspects did you particularly
dislike from either medium?
 Unorthodox way of teaching
programming, doesn’t really
cover basic practices like variable
declaration, different variable
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
26
scopes, etc. Mainly teaches
loops/functions.
 Simulation software was very
basic and lacked simple graphics.
 The copy and paste nature of the
tutorial I feel stunted the learning.
What suggestions would you make to
improve either medium?
 Give the user more responsibility
for creating the rest of the
program, since they’ll have no
idea what’s going on.
 Could have had some colour to
the tutorials to engage more?
 Link the simulation and tutorials
into one software
 Add some flow diagrams of the
procedures
 Perhaps the addition of “broken
programming” for bug testing.
Which medium would you personally
prefer to use for learning
programming?
 The simulation is simpler than the
robot, which has greater potential
for confusion.
 The robot.
 The Arduino.
 Robotics based programing.
Which medium would you recommend
to beginner programmers, provided
that both were available to them?
 The simulation first, then the
robot once they had that figured
out.
 I believe the simulation based
program is easier to understand,
however the robot to be more
engaging.
 Simulation
 Simulation based program, was
much simpler.
Other Comments
 “The first question of the robotics-based program survey should ask how
effective the medium is at teaching programming concepts and syntax.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
27
Results Analysis
Although a small sample size, the data collected throughout the research process
shows a clear difference in opinion even across a select group of fellow Bachelor of
Science students, with many of the surveyed questions yielding responses across three
to four of the five possible answers in the case of the quantitative. Additionally, a
good variety of qualitative comments were also provided, which is particularly helpful
in research projects such as this.
In terms of the general effectiveness of each learning medium, the test group
responded similarly across both, though the data retrieved shows a slight favourability
towards the Arduino robot, with one user stating that the Arduino robot was a ‘very
effective’ medium for learning basic programming.
The next pairing of questions, asked to gather opinions on how effective each medium
would be without the aid of a human teacher, showed an average level of
effectiveness across the test group, though with a clear divide in opinion on the
Arduino, with half the group stating that the Arduino would be ‘effective’. The other
half, on the other hand, stated that the Arduino would either be ‘not effective at all’ or
‘not effective’. Generally, the data shows that the test group has a more consistent
opinion on the effectiveness of the simulation, in this case.
For the final pairing of questions, discussing the effectiveness of either medium with
the aid of a human teacher, showed very consistent results, with both questions only
receiving strongly positive answers. The data collected indicates that the entirety of
the sample group believe that both mediums would be ‘effective’ or ‘very effective’
with the aid of a teacher, who would be able to answer queries and provide overall
guidance.
The qualitative responses yielded from the first of such questions described a liking
for the visual aspect of each medium as it would be clear whether the robot or the
simulation had been programmed correctly, due to the timely nature of visual
feedback, perhaps indicating a slight lean towards a preference of the visual learning
style across the sample group. Additionally, one student found the robot relatable in
terms of their understanding of real physics, which aided in their learning. Another
student expressed a liking for the accessibility of the simulation, over the robot, as
there was little wait time between creating the program and seeing it in effect,
whereas with the robot, users would have to connect it, verify the code, upload the
code, unplug the robot, set it down on an open space and then communicate a function
to it.
In terms of what the test group disliked from either medium, one commented on the
lack of information of some basic programming principles and practices, such as
variable declaration and scopes. Other test users stated a dislike for the basic nature of
the simulation application, which lacked some simple graphics that would have
improved its appearance. Lastly, a user described a dislike for the ‘copy and paste
nature’ of the tutorial programs, in the sense that it provided all the coding necessary
to complete each stated task, without leaving any room for the learner to figure out the
necessary code themselves.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
28
Numerous areas of improvement were also identified by the test users, including an
important change regarding providing users with more responsibility in terms of
getting the program to work, providing necessary information while not providing all
of the answers, this relates to the previous ‘copy and paste’ point of displeasure
mentioned above. In a similar response, it was suggested that the addition of ‘broken
programming’ would be an effective method of teaching students, as it would
encourage them to find out what’s wrong with each piece of code, enforcing
productive learning. Another user commented that the appearance of the programs
could be more appealing, which could lead to them being more engaging, and another
suggested that the tutorials could have included flow-charts of the procedures
undertaken in each program, adding an additional visual element for those who are
particularly inclined towards that learning style.
On a personal level, the majority of the test group states that they would prefer to
learn programming through the robotics-based medium. However, for beginner
programmers, they universally suggest that the simulation would be more appropriate,
from which they can move onto studying with the Arduino robot, once a suitable level
of programming understanding had been acquired.
Information regarding the age, occupation and gender of each user was also collected
via the survey, though this held little bearing within such a small and common
research sample, as all test users were of a similar age, ranging between 22 and 26
years old. Additionally, only the male gender was represented in the research
collected above thus leaving no point of comparison between genders. On the scale of
national education, these additional points of data comparison would have significant
bearing, as it would be critical to identify whether those of different age groups or
genders have particular educational leans in terms of learning mediums.
The most consistent opinions collected through this primary research process include
the description of a clear benefit to the presence of teachers in learning environments,
indicating that, at least in terms of the quality of education the two provided mediums
could supply, robotics and simulations cannot entirely replace qualified human
assistance in places of learning. This indicative need for teachers in the learning
environment is consistent with the research conducted as part of the preliminary
literature review, stating that, in addition to providing direct instruction, the teacher is
also required to take on ‘a “technical” support role’, which would be particularly true
within technology-based subjects.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
29
Conclusion
Due to the comparatively small sample size of test users, the primary research results
displayed above are altogether inconclusive, though they do show some consistent
opinions across individuals who are already greatly experienced in educational
computing. These consistent opinions mostly lie in the recommendations of using the
simulation to teach complete beginners, the improvement in learning that qualified
teachers provide, and a personal preference, across most Bachelor of Science
computing students, to continue their learning through the robotics-based medium.
However, the questions above that yielded a great diversity of responses show that a
preference in learning styles and mediums will typically depend greatly on the
individual learner. This shows some weakness in the originally proposed research
question, as any answer provided would not represent the preferences of every
student.
Humans, by nature, have distinct differences in how they progress, and by which
methods they can best expand their knowledge and proficiency in particular subject
areas. In an ideal world, the most effective way of providing programming education
would be to provide all possible learning mediums to each and every student, so that
any student at any time would be able to receive the most benefit to their learning.
However, in reality, costs and organizational difficulties of supplying each student
with their own robot, for example, make this an unlikely luxury in the present;
therefore, greater sample sizes for primary research processes, as undertaken in this
project, is required in order to determine which methods the majority of students
prefer, in hopes to determine the most effective course of action for the education
sector to take.
Future Developments
Some responses gathered through the research process show a weakness in the
appearance and functionality of the simulation-based program, as well as the structure
and delivery of the exercises provided in the tutorials. This indicates that
improvement across both criticised applications would be required in order to bring
them to a professional level for the conduction of wider research, as quality of these
applications could have a negative impact on the opinions of students if either
medium is not represented well. With additional development time, the functionality
of the simulation would be a priority, in terms of the tasks that it can achieve, as it
should be able to demonstrate the accomplishment of the same functions as the robot.
After the completion of these improvements, a greater scale of research groups, with
individuals of varying abilities, would provide additional credibility to the concluding
thoughts of the project. Alternative angles of research can also be applied within the
project for the future, such as sample groups including ‘disadvantaged students’, for
which, when tested, the ‘effects of CBT (Computer-Based Teaching) … were
stronger’ (Bangert-Drowns et al., 1985).
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
30
Personal Evaluation
Throughout the course of the project, numerous skills, both existing and new, were
practiced and acquired, respectively, particularly due to inexperience in programming
robots, constructing tutorials, and developing simulations. The primary existing skills
that experienced a great deal of practice and development include the construction of
academic documents, the citation of more diverse sources, project management
processes, human-computer interaction principles, Visual Basic and C++
programming, testing procedures, and critical analysis. However, in terms of the
practical capability of the developed applications, while adequate for the purposes of
this primary research project, would require additional development in order to be
suitable for study conducted on a national level, or within professional institutions.
Despite the shortcomings of the developed mediums, they provided an opportunity to
engage in new areas of programming, such as utilizing the SDL library and more
advanced implementations of C++, in addition to utilizing new features of windows
applications.
The project also provided an opportunity to gain some experience in conducting
research surveys and the collection of primary data, which has been valuable, despite
the small research sample size of students. This small research group is an additional
weakness of the project, and was caused primarily due to the slow development of the
programming applications. As development of the applications came to a close, there
was little time remaining to organize the originally desired test groups, and thus the
findings of the project were of an overall lower quality than initially hoped.
Overall, I believe that a combination of both new skills and existing skills saw a great
deal of progress, and I am presently confident in my ability to produce professional-
level documentation.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
31
References
Bangert-Drowns,R.L.,Kulik,J.A.&Kulik,C.-l.C.,1985. Effectivenessof computer-based
education in secondary schools.
Catlin,D..B.M.,2012. The Principles of EducationalRoboticApplications(ERA):A framework
forunderstanding and developing educationalrobotsand theiractivities.ValiantTechnology
Ltd, CanterburyChristChurchUniversity.
Cooper,M..K.D..H.W..D.K.,1999. Robotsin the Classroom - Toolsfor AccessibleEducation.
Reading,UK:OpenUniversity,Universityof Reading.
D'Agostino,D.,2014. SDL2: Keyboard and MouseMovement(Events).[Online]Available at:
http://programmersranch.blogspot.co.uk/2014/02/sdl2-keyboard-and-mouse-movement-
events.html[Accessed1April 2016].
LarsTech,2014. Moving PictureBox using Timer. [Online] Available at:
http://stackoverflow.com/questions/22666555/moving-picturebox-using-timer[Accessed
April 2016].
SDL, 2016. AboutSDL.[Online]Available at:https://www.libsdl.org/ [Accessed10May
2016].
Storer,J.,2016. Action Plan forResearch Project.Bath: Bath College.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
32
Appendix
Appendix A: Complete Arduino Exercise Source Code
/**************************************************************************/
#include <Makeblock.h>
#include <Arduino.h>
#include <SoftwareSerial.h>
#include <Wire.h>
MeDCMotor MotorL(M1);
MeDCMotor MotorR(M2);
MeInfraredReceiver infraredReceiverDecode(PORT_6);
int moveSpeed = 78;
boolean leftflag,rightflag;
int minSpeed = 10;
int LoopNumber = 0;
// int factor = 23;
void setup()
{
infraredReceiverDecode.begin();
}
void loop()
{
if(infraredReceiverDecode.available()||infraredReceiverDecode.buttonState())
{
switch(infraredReceiverDecode.read())
{
case IR_BUTTON_PLUS:
Forward();
break;
case IR_BUTTON_MINUS:
Backward();
break;
case IR_BUTTON_NEXT:
TurnRight();
break;
case IR_BUTTON_PREVIOUS:
TurnLeft();
break;
case IR_BUTTON_1:
ForwardAndBackFunction();
break;
case IR_BUTTON_2:
SquareFunction();
break;
case IR_BUTTON_3:
TriangleFunction();
break;
case IR_BUTTON_4:
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
33
CircleFunction();
break;
case IR_BUTTON_5:
FunctionFive();
break;
case IR_BUTTON_6:
FunctionSix();
break;
case IR_BUTTON_7:
FunctionSeven();
break;
case IR_BUTTON_8:
FunctionEight();
break;
case IR_BUTTON_9:
FunctionNine();
break;
}
}
else
{
Stop();
}
}
void Forward()
{
//Move forward for one second
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
}
void Backward()
{
MotorL.run(-moveSpeed);
MotorR.run(-moveSpeed);
delay(1000);
}
void TurnLeft()
{
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(650);
}
void TurnRight()
{
MotorL.run(-moveSpeed);
MotorR.run(moveSpeed);
delay(650);
}
void Stop()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
34
{
MotorL.run(0);
MotorR.run(0);
}
void ChangeSpeed(int spd)
{
moveSpeed = spd;
}
void ForwardAndBackFunction()
{
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(-moveSpeed);
MotorR.run(-moveSpeed);
delay(1000);
}
void SquareFunction()
{
while (LoopNumber != 4)
{
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(650);
LoopNumber++;
}
}
void TriangleFunction()
{
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(325);
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(650);
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(975);
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
35
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
}
void CircleFunction()
{
MotorL.run(moveSpeed);
MotorR.run(minSpeed);
delay(5500);
}
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
36
Appendix B: Complete Simulation Exercise Source Code – C++ & SDL
#include <SDL.h>
int main(int argc, char ** argv)
{
bool Quit = false;
SDL_Event event;
int x = 360;
int y = 240;
SDL_Init(SDL_INIT_VIDEO);
SDL_Window * window = SDL_CreateWindow("Simulator Program - C++ & SDL",
SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0);
SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, 0);
SDL_Surface * image = SDL_LoadBMP("Star.bmp");
SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, image);
SDL_FreeSurface(image);
SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0);
while (!Quit)
{
switch (event.type)
{
case SDL_QUIT:
Quit = true;
break;
case SDL_KEYDOWN:
switch (event.key.keysym.sym)
{
case SDLK_1:
x-=4;
break;
case SDLK_2:
x+=4;
break;
case SDLK_3:
y-=4;
break;
case SDLK_4:
y+=4;
break;
}
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
37
break;
}
SDL_Rect dstrect = {x, y, 75, 75};
SDL_RenderClear(renderer);
SDL_RenderCopy(renderer, texture, NULL, &dstrect);
SDL_RenderPresent(renderer);
}
SDL_DestroyTexture(texture);
SDL_DestroyRenderer(renderer);
SDL_DestroyWindow(window);
SDL_Quit();
return 0;
}
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
38
Appendix C: Complete Simulation Exercise Source Code – VB
Public Class VBSimulator
Private Sub StarSprite_Click(sender As System.Object, e As
System.EventArgs) Handles StarSprite.Click
StarSprite.Top -= 50
End Sub
Private Time As Integer
Private Sub MovementTimer_Tick(sender As System.Object, e As
System.EventArgs) Handles MovementTimer.Tick
Time += 10
'Moving the sprite up and down.
' If Time <= 20 Then
'StarSprite.Top += 50
' ElseIf Time > 20 AndAlso Time <= 40 Then
' StarSprite.Top -= 50
'Else
' Time = 0
' End If
' Moving the Sprite along a square path.
' If Time <= 20 Then
' StarSprite.Left += 50
' ElseIf Time > 20 AndAlso Time <= 40 Then
' StarSprite.Top += 50
' ElseIf Time > 40 AndAlso Time <= 60 Then
' StarSprite.Left -= 50
' ElseIf Time > 60 AndAlso Time <= 80 Then
' StarSprite.Top -= 50
' Else
' Time = 0
' End If
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
39
Appendix D: Arduino and Simulation Tutorial Source Code
Main Switchboard
Public Class MainSwitchboard
Private Sub btnTutorialOne_Click(sender As System.Object, e As
System.EventArgs) Handles btnTutorialOne.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub btnTutorialTwo_Click(sender As System.Object, e As
System.EventArgs) Handles btnTutorialTwo.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub btnTutorialThree_Click(sender As System.Object, e As
System.EventArgs) Handles btnTutorialThree.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub btnTutorialFour_Click(sender As System.Object, e As
System.EventArgs) Handles btnTutorialFour.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub btnTutorialFive_Click(sender As System.Object, e As
System.EventArgs) Handles btnTutorialFive.Click
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
TutorialTwo.Show()
Me.Hide()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
40
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnExit_Click(sender As System.Object, e As System.EventArgs)
Handles btnExit.Click
TutorialOne.Close()
TutorialTwo.Close()
TutorialThree.Close()
TutorialFour.Close()
TutorialFive.Close()
Me.Close()
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
TutorialOne.Close()
TutorialTwo.Close()
TutorialThree.Close()
TutorialFour.Close()
TutorialFive.Close()
Me.Close()
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
41
Tutorial One
Public Class TutorialOne
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
MainSwitchboard.Close()
TutorialTwo.Close()
TutorialThree.Close()
TutorialFour.Close()
TutorialFive.Close()
Me.Close()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialOne.LinkClicked
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
42
End Sub
Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialTwo.LinkClicked
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialThree.LinkClicked
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFour.LinkClicked
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFive.LinkClicked
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs)
Handles btnNext.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub btnPrevious_Click(sender As System.Object, e As
System.EventArgs) Handles btnPrevious.Click
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnMainMenu_Click(sender As System.Object, e As
System.EventArgs) Handles btnMainMenu.Click
MainSwitchboard.Show()
Me.Hide()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
43
End Sub
Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles MainMenuToolStripMenuItem.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
44
Tutorial Two
Public Class TutorialTwo
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)
Handles btnMainMenu.Click
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
TutorialOne.Close()
MainSwitchboard.Close()
TutorialThree.Close()
TutorialFour.Close()
TutorialFive.Close()
Me.Close()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
TutorialFive.Show()
Me.Hide()
End Sub
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
45
Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialOne.LinkClicked
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialTwo.LinkClicked
End Sub
Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialThree.LinkClicked
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFour.LinkClicked
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFive.LinkClicked
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs)
Handles btnNext.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub btnPrevious_Click(sender As System.Object, e As
System.EventArgs) Handles btnPrevious.Click
TutorialOne.Show()
Me.Hide()
End Sub
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
46
Private Sub btnMainMenu_Click(sender As System.Object, e As
System.EventArgs) Handles btnMainMenu.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles MainMenuToolStripMenuItem.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
47
Tutorial Three
Public Class TutorialThree
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)
Handles btnMainMenu.Click
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
TutorialOne.Close()
TutorialTwo.Close()
MainSwitchboard.Close()
TutorialFour.Close()
TutorialFive.Close()
Me.Close()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
TutorialFive.Show()
Me.Hide()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
48
End Sub
Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialOne.LinkClicked
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialTwo.LinkClicked
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialThree.LinkClicked
End Sub
Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFour.LinkClicked
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFive.LinkClicked
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs)
Handles btnNext.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub btnPrevious_Click(sender As System.Object, e As
System.EventArgs) Handles btnPrevious.Click
TutorialTwo.Show()
Me.Hide()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
49
End Sub
Private Sub btnMainMenu_Click(sender As System.Object, e As
System.EventArgs) Handles btnMainMenu.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles MainMenuToolStripMenuItem.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
50
Tutorial Four
Public Class TutorialFour
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)
Handles btnMainMenu.Click
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
TutorialOne.Close()
TutorialTwo.Close()
TutorialThree.Close()
MainSwitchboard.Close()
TutorialFive.Close()
Me.Close()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
TutorialFive.Show()
Me.Hide()
End Sub
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
51
Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialOne.LinkClicked
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialTwo.LinkClicked
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialThree.LinkClicked
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFour.LinkClicked
End Sub
Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFive.LinkClicked
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs)
Handles btnNext.Click
TutorialFive.Show()
Me.Hide()
End Sub
Private Sub btnPrevious_Click(sender As System.Object, e As
System.EventArgs) Handles btnPrevious.Click
TutorialThree.Show()
Me.Hide()
End Sub
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
52
Private Sub btnMainMenu_Click(sender As System.Object, e As
System.EventArgs) Handles btnMainMenu.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles MainMenuToolStripMenuItem.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
End Class
Tutorial Five
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
53
Public Class TutorialFive
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs)
Handles btnMainMenu.Click
End Sub
Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles ExitToolStripMenuItem.Click
TutorialOne.Close()
TutorialTwo.Close()
TutorialThree.Close()
TutorialFour.Close()
MainSwitchboard.Close()
Me.Close()
End Sub
Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e
As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click
End Sub
Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialOne.LinkClicked
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
54
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialTwo.LinkClicked
TutorialTwo.Show()
Me.Hide()
End Sub
Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialThree.LinkClicked
TutorialThree.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFour.LinkClicked
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As
System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles
linkTutorialFive.LinkClicked
End Sub
Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs)
Handles btnNext.Click
TutorialOne.Show()
Me.Hide()
End Sub
Private Sub btnPrevious_Click(sender As System.Object, e As
System.EventArgs) Handles btnPrevious.Click
TutorialFour.Show()
Me.Hide()
End Sub
Private Sub btnMainMenu_Click(sender As System.Object, e As
System.EventArgs) Handles btnMainMenu.Click
MainSwitchboard.Show()
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
55
Me.Hide()
End Sub
Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As
System.EventArgs) Handles MainMenuToolStripMenuItem.Click
MainSwitchboard.Show()
Me.Hide()
End Sub
End Class
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
56
Appendix E: Tutorial Contents
Arduino Tutorial
Tutorial One:
The Arduino robot is programmed in a variant of C++, using its own custom library
for essential commands. In this exercise, the Arduino robot will be programmed to be
controlled by an infra-red (IR) controller.
In the blank IR Control program, provided with this tutorial, the infra-red controller is
programmed to run specific functions depending on which button is pressed.
case IR_BUTTON_1:
ForwardAndBackFunction();
break;
The above case, for example, will load the ‘ForwardAndBackFunction’ from lower
down in the program, which is presently blank. This function will be completed in the
following tutorial.
For the robot to move, each motor, left and right, must be commanded to run at a
certain speed. The speeds required to complete the following activities are defined
towards the top of the program, but can be changed at any time:
int moveSpeed = 78;
int minSpeed = 10;
In order to communicate a speed value to each motor, the following command should
be used:
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
In the above example, both motors are being told to run at the speed of 78, or
‘moveSpeed’. However, this would cause them to run for a very brief moment before
turning off again. If we want to keep the motors running for 1 second, we can use the
‘delay()’ command, to delay the end of the function for 1 second, written as
milliseconds in the program:
delay(1000);
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
57
Tutorial Two:
Now that we understand how to tell the motors to run forward at a given speed, we
can also cover how to make them reverse. In order to tell the motors to reverse, we
just need to negatively apply the ‘moveSpeed’, as shown below:
MotorL.run(-moveSpeed);
MotorR.run(-moveSpeed);
For the forward and back function, we want to be able to move the robot forward at
the given movement speed for one second and then reverse at the same speed for
another second. The ‘1’ button on the IR controller is already programmed to initiate
the function for this, but it is currently empty. To accomplish this, the
‘ForwardAndBackFunction’ can be populated like so:
void ForwardAndBackFunction()
{
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(-moveSpeed);
MotorR.run(-moveSpeed);
delay(1000);
}
In order to upload this new portion of code to the robot, ensure that the Arduino is
connected to the PC and click the ‘Verify’ button at the top left of the Arduino
software. This will compile and build the code. Then, if successful, click the ‘Upload’
button beside it. Once the transfer is complete, disconnect the Arduino robot and test
the ‘ForwardAndBackFunction’ by pressing the ‘1’ button on the controller.
Tutorial Three:
The next technique of Arduino programming that we need to learn is how to make the
robot turn. To do this, we need to tell the motor of one side to run forwards and the
other motor to run backwards. So, applying similar code to that of the previous
tutorials, we can turn it by 90 degrees by applying a delay of roughly 650, provided
that the original ‘moveSpeed’ value has not been changed.
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(650);
The above three lines of code will rotate the robot clockwise by 90 degrees. We can
use this, paired with moving forward, to move the robot forward and then rotate it by
90 degrees. This can be repeated four times in order to get the robot to move along a
square-like path. In order to efficiently do this, we can use a ‘while’ loop:
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
58
void SquareFunction()
{
while (LoopNumber != 4)
{
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(650);
LoopNumber++
}
}
The above section of code says that while our ‘LoopNumber’, set as 0 towards the top
of the code, does not equal 4, move the Arduino forward for 1 second and then rotate
it by 90 degrees. Once this is done, our ‘LoopNumber’ is incremented, increased by 1,
before repeating the process. This continues until our ‘LoopNumber’ reaches 4, which
will end the function. The ‘SquareFunction’, by default, will be activated by pressing
the ‘2’ button in the controller.
Tutorial Four:
Much like in the previous tutorials, the task of moving the robot along a triangle-
shaped path involves moving forward and rotating but with escalating degrees of
rotation, in the case of an equilateral triangle.
Initially, the robot must be turned by 45 degrees, assuming it is starting on the
bottom-left corner of a standing equilateral triangle, to appropriately lean the first side
of the triangle. To turn the robot by 45 degrees, we half the 90 degree delay value
applied to the rotation to 325. After this rotation, the robot should travel forward, for 1
second again, before rotating by 90 degrees and moving forward again for another
second. Lastly, a final rotation of 135 degrees needs to be made, the code for which is
shown below:
void TriangleFunction()
{
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(325);
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
59
delay(650);
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
MotorL.run(moveSpeed);
MotorR.run(-moveSpeed);
delay(975);
MotorL.run(moveSpeed);
MotorR.run(moveSpeed);
delay(1000);
}
}
This function is called on by pressing the ‘3’ button on the infra-red controller.
Tutorial Five:
For the final task of making the robot travel in a full circle, another speed value must
be called upon. This second value is determined by the ‘minSpeed’ integer towards
the top of the program. By default, this speed is set to 10, which should be applied to
the ‘inside’ motor of the turn, while applying the ‘moveSpeed’ value to the ‘outside’
motor:
void CircleFunction()
{
MotorL.run(moveSpeed);
MotorR.run(minspeed);
delay(2600);
}
A delay of 2600 milliseconds has been chosen in the example above, and should
perform a full clockwise circle, depending on the floor space available. If the floor
space is fairly small, a higher speed on the ‘outside’ motor, or a lower speed on the
‘inside’ motor can be applied. This is called upon by pressing the ‘4’ button on the
controller.
Additional functions have been left unnamed and empty below the example functions
for experimentation, but have been attached to the corresponding buttons of the infra-
red controller.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
60
Simulator Tutorial
Tutorial One:
The simulation program provided has been programmed in Visual Basic, used to
create a Windows form application. Upon start-up of the program, you’ll see a
window titled as ‘Simulator Program – VB [Design]’, a ‘PictureBox’ in the centre
which contains a star sprite, and a lower panel that includes a clock icon labelled as
‘MovementTimer’.
The star sprite will be the object which we will want to move around the screen,
which will be done by attaching movement commands that play out over time. Which
movement commands are activated when will be determined by how many ticks of
the timer has passed since the start of the program.
For windows programs, it is important to bear in mind that the axis is inverted, so
vertical pixel-based movements will need to be inverted also. For example, if we want
the sprite to move upwards, we would have to tell the sprite to move -50 pixels along
the ‘Y’ axis.
Tutorial Two:
Presently, none of the aforementioned form elements really do anything. In order to
apply coding to them, we need to right click on the program in the ‘Solution
Explorer’, likely on the right-hand side of the screen, and select ‘View Code’.
Presently, the code only contains two sub-routines and a defined integer, ‘Time’,
which will be used to determine which movement command takes place and when,
along with the ‘Private Sub MovementTimer_Tick…’ sub-routine.
The ‘Private Sub StartSprite_Click…’ sub-routine will be a set of instructions which
trigger when the sprite is clicked on, which will be expanded upon in the following
tutorial.
Tutorial Three:
In this tutorial, we will populate the ‘StarSprite_Click’ sub-routine, so that the sprite
will move upwards when clicked on. In order to do this, we need to enter the
following command into the sub-routine:
StarSprite.Top -= 50
The ‘StarSprite’ component of the line of code above refers to the object we are
moving, and the ‘.top’ portion refers to the distance between the top of the window
and the object. The final ‘-= 50’ reduces the existing distance by 50 pixels, therefore
moving the image upwards.
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
61
Once the above code has been implemented, save the project by using ‘File’ -> ‘Save
All’, or CTRL+S, and then run the project in ‘debugging’ mode, by pressing F5 or by
clicking the green arrow icon at the top of the application, to test if it works.
Tutorial Four:
As we are supposed to be simulating movement along set paths, which occur over
time, we should now understand how to use the ticks of the ‘MovementTimer’ to
communicate which movement commands should occur. The ‘MovementTimer_Tick’
sub-routine will be called upon and executed whenever the timer ticks, which is set to
do so every 100 milliseconds.
Initially, 10 will be added to the current value stored in the ‘Time’ integer whenever
the timer ticks, which will then be used as a point of comparison for the following ‘If’
event:
Time += 10
If Time <= 20 Then
StarSprite.Top += 50
ElseIf Time > 20 AndAlso Time <= 40 Then
StarSprite.Top -= 50
Else
Time = 0
End If
The ‘If’ event states that if the ‘Time’ value is less than or equal to 20, then add 50
pixels to the distance between the top of the window and the sprite. Otherwise, if the
‘Time’ value becomes greater than 20 but less than or equal to 40, then move the
sprite down by 50 pixels. Once the ‘Time’ value reaches above 40, it will then reset
the ‘Time’ value to 0, which, being less than 20, would make it move down again.
This cycle will repeat until the program is closed.
Tutorial Five:
For the final task, we want the sprite to move repeatedly along a square path, which
can be accomplished by extending the timer-based method used previously to move
the sprite up and down. For this, we will need to be able to move the sprite
horizontally, or along the ‘X’ axis, which can be done using the following command:
StarSprite.Left += 50
The above command will move the sprite 50 pixels to the right, as ‘.Left’ refers to the
distance between the image and the left-hand border of the window. So, by extending
the timer-based system implemented above, we can move the image along a square
path by replacing our old code with the following:
Time += 10
If Time <= 20 Then
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
62
StarSprite.Left += 50
ElseIf Time > 20 AndAlso Time <= 40 Then
StarSprite.Top += 50
ElseIf Time > 40 AndAlso Time <= 60 Then
StarSprite.Left -= 50
ElseIf Time > 60 AndAlso Time <= 80 Then
StarSprite.Top -= 50
Else
Time = 0
End If
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
63
Appendix F: Project Program SurveyTemplate
Robotics-Based Programming vs.
Simulation-Based Programming
Survey
Age:
Gender:
Occupation:
Simulation-BasedProgram
1. Do you feel that the simulation was an effective medium for learning basic
programming?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
2. How effective do you think the simulation would be in teaching you
programming without the aid of a human teacher?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
3. How effective would the addition of a human teacher be when learning
through this medium?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
64
Robotics-BasedProgram
1. Do you feel that the Arduino robot was an effective medium for learning
basic programming?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
2. How effective do you think the Arduino robot would be in teaching you
programming without the aid of a human teacher?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
3. How effective would the addition of a human teacher be when learning
through this medium?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
65
Evaluative Questions
1. Which aspects did you particularly like from either medium?
2. Which aspects did you particularly dislike from either medium?
3. What suggestions would you make to improve either medium?
Other Comments
4. Which medium would you personally prefer to use for learning
programming?
5. Which medium would you recommend to beginner programmers,
provided that both were available to them?
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
66
Appendix G: Completed Project Surveys
Robotics-Based Programming vs.
Simulation-Based Programming
Survey
Age: 22
Gender: Male
Occupation: Student (accounts executive)
Simulation-BasedProgram
4. Do you feel that the simulation was an effective medium for learning basic
programming?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
5. How effective do you think the simulation would be in teaching you
programming without the aid of a human teacher?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
6. How effective would the addition of a human teacher be when learning
through this medium?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
67
Robotics-BasedProgram
4. Do you feel that the Arduino robot was an effective medium for learning
basic programming?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
5. How effective do you think the Arduino robot would be in teaching you
programming without the aid of a human teacher?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
6. How effective would the addition of a human teacher be when learning
through this medium?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
68
Evaluative Questions
6. Which aspects did you particularly like from either medium?
Was able to relate to the robot with prior knowledge about wheel speeds in order to
determine direction
7. Which aspects did you particularly dislike from either medium?
N/A
8. What suggestions would you make to improve either medium?
Could have had some colour to the tutorials to engage more?
Other Comments
9. Which medium would you personally prefer to use for learning
programming?
The robot
10. Which medium would you recommend to beginner programmers,
provided that both were available to them?
I believe the simulation based program is easier to understand, however the robot to
be more engaging
Jacob Edward Storer BSc Applied Computing 12/05/2016
Project Report - LP30483
69
Robotics-Based Programming vs.
Simulation-Based Programming
Survey
Age: 26
Gender: Male
Occupation: IT Technician
Simulation-BasedProgram
7. Do you feel that the simulation was an effective medium for learning basic
programming?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
8. How effective do you think the simulation would be in teaching you
programming without the aid of a human teacher?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
9. How effective would the addition of a human teacher be when learning
through this medium?
Not effective
at all
Not very
effective
Somewhat
effective
Effective Very effective
X
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming
Robotics-Based Learning in the Context of Computer Programming

Weitere ähnliche Inhalte

Was ist angesagt?

Assignment2 nguyen tankhoi
Assignment2 nguyen tankhoiAssignment2 nguyen tankhoi
Assignment2 nguyen tankhoiVnhTngLPhc
 
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...IJITE
 
Project528
Project528Project528
Project528jhtrespa
 
Capstone Project Final Report Sample
Capstone Project Final Report SampleCapstone Project Final Report Sample
Capstone Project Final Report SampleCapstone Project
 
應用行動科技紀錄與研究人們日常生活行為與脈絡
應用行動科技紀錄與研究人們日常生活行為與脈絡 應用行動科技紀錄與研究人們日常生活行為與脈絡
應用行動科技紀錄與研究人們日常生活行為與脈絡 Stanley Chang
 
IRJET- Semantic Question Matching
IRJET- Semantic Question MatchingIRJET- Semantic Question Matching
IRJET- Semantic Question MatchingIRJET Journal
 
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMS
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMSDRES Work Skills 2020 - New Media Literacy Ryan.ADAMS
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMSRyan Adams
 
Join the PLML Team in developing a Multiplication Teaching Tool
Join the PLML Team in developing a Multiplication Teaching ToolJoin the PLML Team in developing a Multiplication Teaching Tool
Join the PLML Team in developing a Multiplication Teaching Tooldaveplml
 
Requirementv4
Requirementv4Requirementv4
Requirementv4stat
 
Running head cyber security competition framework cyber securi
Running head cyber security competition framework cyber securiRunning head cyber security competition framework cyber securi
Running head cyber security competition framework cyber securiDIPESH30
 
Report of Previous Project by Yifan Guo
Report of Previous Project by Yifan GuoReport of Previous Project by Yifan Guo
Report of Previous Project by Yifan GuoYifan Guo
 

Was ist angesagt? (15)

Assignment2 nguyen tankhoi
Assignment2 nguyen tankhoiAssignment2 nguyen tankhoi
Assignment2 nguyen tankhoi
 
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...
Immediate Feedback : A New Mechanism for Real Time Feedback on Classroom Teac...
 
Project528
Project528Project528
Project528
 
H02 syllabus
H02 syllabusH02 syllabus
H02 syllabus
 
Capstone Project Final Report Sample
Capstone Project Final Report SampleCapstone Project Final Report Sample
Capstone Project Final Report Sample
 
應用行動科技紀錄與研究人們日常生活行為與脈絡
應用行動科技紀錄與研究人們日常生活行為與脈絡 應用行動科技紀錄與研究人們日常生活行為與脈絡
應用行動科技紀錄與研究人們日常生活行為與脈絡
 
IRJET- Semantic Question Matching
IRJET- Semantic Question MatchingIRJET- Semantic Question Matching
IRJET- Semantic Question Matching
 
Mr1480.ch5
Mr1480.ch5Mr1480.ch5
Mr1480.ch5
 
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMS
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMSDRES Work Skills 2020 - New Media Literacy Ryan.ADAMS
DRES Work Skills 2020 - New Media Literacy Ryan.ADAMS
 
final
finalfinal
final
 
Join the PLML Team in developing a Multiplication Teaching Tool
Join the PLML Team in developing a Multiplication Teaching ToolJoin the PLML Team in developing a Multiplication Teaching Tool
Join the PLML Team in developing a Multiplication Teaching Tool
 
Requirementv4
Requirementv4Requirementv4
Requirementv4
 
A044080105
A044080105A044080105
A044080105
 
Running head cyber security competition framework cyber securi
Running head cyber security competition framework cyber securiRunning head cyber security competition framework cyber securi
Running head cyber security competition framework cyber securi
 
Report of Previous Project by Yifan Guo
Report of Previous Project by Yifan GuoReport of Previous Project by Yifan Guo
Report of Previous Project by Yifan Guo
 

Ähnlich wie Robotics-Based Learning in the Context of Computer Programming

An investigation into the physical build and psychological aspects of an inte...
An investigation into the physical build and psychological aspects of an inte...An investigation into the physical build and psychological aspects of an inte...
An investigation into the physical build and psychological aspects of an inte...Jessica Navarro
 
E.Leute: Learning the impact of Learning Analytics with an authentic dataset
E.Leute: Learning the impact of Learning Analytics with an authentic datasetE.Leute: Learning the impact of Learning Analytics with an authentic dataset
E.Leute: Learning the impact of Learning Analytics with an authentic datasetHendrik Drachsler
 
Online Learning Management System and Analytics using Deep Learning
Online Learning Management System and Analytics using Deep LearningOnline Learning Management System and Analytics using Deep Learning
Online Learning Management System and Analytics using Deep LearningDr. Amarjeet Singh
 
10.MIL 9. Current and Future Trends in Media and Information.pptx
10.MIL 9. Current and Future Trends in Media and Information.pptx10.MIL 9. Current and Future Trends in Media and Information.pptx
10.MIL 9. Current and Future Trends in Media and Information.pptxEdelmarBenosa3
 
Id project 1
Id project 1Id project 1
Id project 1josh30000
 
Enhancing Video Understanding: NLP-Based Automatic Question Generation
Enhancing Video Understanding: NLP-Based Automatic Question GenerationEnhancing Video Understanding: NLP-Based Automatic Question Generation
Enhancing Video Understanding: NLP-Based Automatic Question GenerationIRJET Journal
 
Pawlik
PawlikPawlik
Pawlikanesah
 
Tugasan 4 buku teks
Tugasan 4 buku teksTugasan 4 buku teks
Tugasan 4 buku tekshelidzia
 
Tugasan 4 buku teks
Tugasan 4 buku teksTugasan 4 buku teks
Tugasan 4 buku tekshelidzia
 
The Generative AI System Shock, and some thoughts on Collective Intelligence ...
The Generative AI System Shock, and some thoughts on Collective Intelligence ...The Generative AI System Shock, and some thoughts on Collective Intelligence ...
The Generative AI System Shock, and some thoughts on Collective Intelligence ...Simon Buckingham Shum
 
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdf
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdfLEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdf
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdfssuser08e250
 
Computer based online written test system "Tao Software"
Computer based online written test system "Tao Software"Computer based online written test system "Tao Software"
Computer based online written test system "Tao Software"Awais Chaudhary
 
Innovative uses of technology in schools of the future
Innovative uses of technology in schools of the futureInnovative uses of technology in schools of the future
Innovative uses of technology in schools of the futureJonathan Martin
 
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)Qazi Maaz Arshad
 
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...Christoph Rensing
 
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPER
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPERCRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPER
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPERvivatechijri
 

Ähnlich wie Robotics-Based Learning in the Context of Computer Programming (20)

An investigation into the physical build and psychological aspects of an inte...
An investigation into the physical build and psychological aspects of an inte...An investigation into the physical build and psychological aspects of an inte...
An investigation into the physical build and psychological aspects of an inte...
 
Virtual Flipped Classroom
Virtual Flipped ClassroomVirtual Flipped Classroom
Virtual Flipped Classroom
 
E.Leute: Learning the impact of Learning Analytics with an authentic dataset
E.Leute: Learning the impact of Learning Analytics with an authentic datasetE.Leute: Learning the impact of Learning Analytics with an authentic dataset
E.Leute: Learning the impact of Learning Analytics with an authentic dataset
 
Online Learning Management System and Analytics using Deep Learning
Online Learning Management System and Analytics using Deep LearningOnline Learning Management System and Analytics using Deep Learning
Online Learning Management System and Analytics using Deep Learning
 
10.MIL 9. Current and Future Trends in Media and Information.pptx
10.MIL 9. Current and Future Trends in Media and Information.pptx10.MIL 9. Current and Future Trends in Media and Information.pptx
10.MIL 9. Current and Future Trends in Media and Information.pptx
 
PMC8
PMC8PMC8
PMC8
 
Id project 1
Id project 1Id project 1
Id project 1
 
Enhancing Video Understanding: NLP-Based Automatic Question Generation
Enhancing Video Understanding: NLP-Based Automatic Question GenerationEnhancing Video Understanding: NLP-Based Automatic Question Generation
Enhancing Video Understanding: NLP-Based Automatic Question Generation
 
Pawlik
PawlikPawlik
Pawlik
 
Tugasan 4 buku teks
Tugasan 4 buku teksTugasan 4 buku teks
Tugasan 4 buku teks
 
Tugasan 4 buku teks
Tugasan 4 buku teksTugasan 4 buku teks
Tugasan 4 buku teks
 
The Generative AI System Shock, and some thoughts on Collective Intelligence ...
The Generative AI System Shock, and some thoughts on Collective Intelligence ...The Generative AI System Shock, and some thoughts on Collective Intelligence ...
The Generative AI System Shock, and some thoughts on Collective Intelligence ...
 
ShawnLinerRET2013
ShawnLinerRET2013ShawnLinerRET2013
ShawnLinerRET2013
 
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdf
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdfLEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdf
LEARN PROGRAMMING IN VIRTUAL REALITY_ A PROJECT FOR COMPUTER SCIE.pdf
 
Computer based online written test system "Tao Software"
Computer based online written test system "Tao Software"Computer based online written test system "Tao Software"
Computer based online written test system "Tao Software"
 
Innovative uses of technology in schools of the future
Innovative uses of technology in schools of the futureInnovative uses of technology in schools of the future
Innovative uses of technology in schools of the future
 
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)
Cse443 Project Report - LPU (Modern Big Data Analysis with SQL Specialization)
 
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...
Investigating Crowdsourcing as an Evaluation Method for (TEL) Recommender Sy...
 
Jisc e assess-mar_12
Jisc e assess-mar_12Jisc e assess-mar_12
Jisc e assess-mar_12
 
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPER
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPERCRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPER
CRITERION BASED AUTOMATIC GENERATION OF QUESTION PAPER
 

Robotics-Based Learning in the Context of Computer Programming

  • 1. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 Robotics-Based Learning in the Context of Computer Programming Is it more effective to teach programming via interaction with a computer simulation or via robotics-based learning? Jacob Edward Storer 12/05/2016
  • 2. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 Contents Abstract ..........................................................................................................................1 Introduction....................................................................................................................2 Objectives and Deliverables...........................................................................................3 Objectives...................................................................................................................3 Deliverables................................................................................................................3 Design Decisions............................................................................................................4 Tutorial Design...........................................................................................................4 Programming Tasks....................................................................................................7 Implementation ..............................................................................................................9 The Tutorials ..............................................................................................................9 Arduino Programming..............................................................................................10 Simulation Programming .........................................................................................12 Project Management ....................................................................................................14 Change Control & Change Management .................................................................14 Testing..........................................................................................................................15 Test Plan - Tutorial Applications .............................................................................15 Test Results - Tutorial Applications.........................................................................16 Test Plan - Arduino Program ...................................................................................17 Test Results - Arduino Program...............................................................................18 Test Plan - Visual Basic Simulation Program..........................................................19 Test Results - Visual Basic Simulation Program .....................................................19 The Primary Research Process.....................................................................................21 Research Plan...........................................................................................................21 Quantitative Results .................................................................................................22 Qualitative Results ...................................................................................................25 Other Comments ......................................................................................................26 Results Analysis .......................................................................................................27 Conclusion ...................................................................................................................29 Future Developments ...............................................................................................29 Personal Evaluation......................................................................................................30 References....................................................................................................................31 Appendix......................................................................................................................32
  • 3. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 Appendix A: Complete Arduino Exercise Source Code ..........................................32 Appendix B: Complete Simulation Exercise Source Code – C++ & SDL..............36 Appendix C: Complete Simulation Exercise Source Code – VB ............................38 Appendix D: Arduino and Simulation Tutorial Source Code..................................39 Appendix E: Tutorial Contents ................................................................................56 Appendix F: Project Program SurveyTemplate .......................................................63 Appendix G: Completed Project Surveys ................................................................66 Appendix H: Project Sponsorship Agreement Form................................................78
  • 4. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 1 Abstract This final report includes an insight into the course of development, including objectives, design decisions, implementation processes, the research process itself, and a no throughout the primary research project, which was conducted in order to answer: “Is it more effective to teach programming via interaction with a computer simulation, or via robotics-based learning?” In an attempt to answer this, a robotics-based medium, utilizing an Arduino robot, and a simulation-based medium, utilizing a Visual Basic windows application, were constructed, and a test group was acquired, which were provided with a survey upon completion of the proposed tasks for each medium. Primary data collected through these surveys indicated a great diversity in the opinions of which medium is more effective, though all test subjects indicated a distinct improvement in learning with the presence of a qualified teacher. However, due to the small sample size of test users, no conclusive answer could be provided for the question above.
  • 5. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 2 Introduction With recent UK government-driven efforts in reinforcing the importance of teaching programming to children, research into effective teaching of the field, has rapidly become critical. As a result of this, determining which teaching methods will be most successful at supplying students with robust knowledge is a crucial task. As educational curriculums are becoming increasingly supported by, and dependent upon, computer-based learning, considerations of implementing a wider range of computing applications have grown in popularity. Robotics is one such field, as robots are becoming increasingly useful, in a greater variety of industries, with the abilities of such machines developing and improving over time. Initial research, conducted in the preliminary literature review, revealed that ‘robots have great potential for sound pedagogic reasons within education at all levels’ (Cooper et al. 1999), which enforces the importance of developing methods of fulfilling such potential. However, in order to determine whether this is a worthwhile venture, it must first be determined whether the educational potential of robots is greater than present computer-based learning mediums. Commentary by Dave Catlin and Mike Blamires (2012) states that ‘while teachers share this intuitive view (of physical robots having positive interactions with students), there is little hard data to verify the claim.’ Thus, the aim of this project is to collect and exhibit primary data that either verifies, refutes, or provides additional discussion around the aforementioned claim. This work-based research project has been conducted in order to provide a reasoned answer to the following, initial, research question, as outlined in the initial action plan: “Is it more effective to teach programming via traditional teaching methods or via computer and robotics-based learning?” However, this question has evolved throughout the design phase of the project’s development, as it was deemed unfit for the project’s now decided course. The primary research question is now as follows: “Is it more effective to teach programming via interaction with a computer simulation, or via robotics-based learning?” This developed question now provides an appropriate description of the purpose of the project, and helps to provide a more accurate query, as both research directions will employ computer-based learning, for its ease of distribution and accessibility.
  • 6. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 3 Objectives and Deliverables As no official client was secured, or intended to be, though there is a sponsor for the project who agreed to supply necessary resources, a set of primary objectives and definitive deliverables were self-constructed, as opposed to carrying out the typical process of a requirements capture from a client. These objectives and deliverables were determined as part of the initial project action plan, and are as follows: Objectives 1. Become more familiar with the programming of the Arduino robot. 2. Become more familiar with programming movable sprites in C++. 3. Develop an application to facilitate a simulation, as well as provide a tutorial into programming within Visual Studio. 4. Develop an application that provides a tutorial for the programming of the robot within the Arduino software. 5. Conduct research on two separate test groups, in order to determine the effectiveness of both methods, so that they can be compared. 6. Construct appropriate documentation to contain all development, findings and analysis. Deliverables  An application which facilitates the simulation of a moving sprite, while providing tutorial for how to program its movement.  An application that provides tutorial for the programming of the Arduino robot.  A detailed project report, containing all findings and analysis, as well as details of project management, design decisions and a final review of the project’s requirements. (Storer, 2016)
  • 7. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 4 Design Decisions This section of the report contains a reflective view on the design decisions made throughout the course of development, covering how the finally implemented designs effectively meet the previously defined objectives of the project. Tutorial Design For tutorials to be effective, they need to be clear and comprehensive in relevant areas. While the original objectives were vague as to how much content each tutorial should offer, too much detail provided in irrelevant areas can cause learners to become confused or overwhelmed. The reduction of possible confusion and resulting irritation was a key factor in the design of the two tutorial programs, which would be accomplished by applying effective human-computer interaction principles, to emphasize or make important information clear, while ensuring that no unnecessary information was displayed. Firstly, it was decided that the framework and functionality could be consistent across both tutorials, which provides benefit to users who may be tested with both applications. This consistent framework and functionality also significantly reduced development times for the two tutorials, as two copies of one template could be created and populated with differing information. Before development, it was pre-determined that using the Visual Basic programming language, through Visual Studio 2010, would provide satisfactory design and functionality options. With personal experience in Visual Basic and the availability of Visual Studio 2010 both at home and within Bath College, this seemed like a natural choice. It was also decided that, as part of reducing the chance of users becoming confused, each tutorial application would be divided into five separate tutorials, which would appropriately organize separate tasks or ‘milestones’ in the learning of each medium. To navigate between these sections, it was decided that a main switchboard should be available as a portal to each tutorial ‘chapter’, while also providing the facility for users to neatly close the program. A screenshot of this main menu, from the Arduino tutorial variant, is shown below:
  • 8. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 5 Image: Arduino Robot Tutorial Program – Main Switchboard The above screenshot has been taken from the final version of the tutorial for the Arduino robot, and demonstrates the clarity of the each button, which are clearly labelled for each tutorial, while also showing how separated the ‘Exit’ button is, to prevent accidental closing of the application. Additionally, it was decided that two menu strip items should be included, for easier navigation. Under the ‘File’ menu, two options are provided for either returning to the main menu, or for exiting the program, while the ‘Tutorials’ menu item allows for an alternative method of navigation, from which any of the five tutorials can be navigated to. The following screenshot shows similar design considerations, and was taken from the final implementation of the Arduino tutorial:
  • 9. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 6 Image: Arduino Robot Tutorial Program – Tutorial 1 The screenshot above captures the design for each tutorial segment, which displays a large, clear area for the actual tutorial contents, with additional navigation options of buttons that allow users to navigate to the next, or previous tutorial, which are disabled on the last and first tutorial section respectively, as well as allowing the user to return to the main menu. Additionally, text links have been added to the left hand side, in case users wish to navigate to a specific tutorial. It was decided that creating these with the typical hyperlink-style design would be effective, and would be consistent with the users’ present understanding of text-based links. The content of these tutorials was determined after the construction of both the Arduino robot program and the simulation, as the exercises that would be provided to learners would depend greatly on how simple particular sprite, or robot, movement- based tasks could be implemented and taught. The implemented tutorial reflects the programming tasks described in the following section.
  • 10. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 7 Programming Tasks For an effective comparison between the two proposed learning mediums, it was determined that the tasks which the research group would have to learn and complete would have to be largely similar. It was also deemed to be important that these tasks should be terse and easily separable, so that they can be taught effectively in a segmented style of tutorial. As the Arduino robot’s primary functionality lies in its mobility, it became apparent that the best method of comparison would be to develop an application which focuses on a simulated sprite’s capability of movement. During the initial ‘trying out’ session of the Arduino robot, it was discovered that it could be programmed fairly simply to travel forwards and backwards, and perform turning exercises when applying different speeds to each of the two motors. This clear functionality of the Arduino robot lent itself to being programmed to move along a set ‘path’, as in pre- determining a shape or pattern for its movement. From this, it was decided that the Arduino robot could be programmed for a number of separate tasks, these finally being:  Moving forwards and backwards.  Moving along a square-shaped perimeter.  Moving along a triangle-shaped perimeter.  Performing a complete circle of movement. The above four tasks suited the project well, as they were all fairly simple to program and showed a clear different outcome for each of them. Additionally, these four tasks could also be separately neatly into five tutorial segments, including an introductory tutorial to the Arduino’s functionality in general. As the Arduino robot was programmed with its own software, with no interface between it and the robot hardware, no design considerations were necessary for the code to be communicated to the robot, aside from ensuring that it was separated appropriately and easily readable. It was also initially determined that the simulation should provide a sprite capable of moving along similar, if not the same, patterns. This, truthfully, would have been ideal, but for reasons explained in the following ‘Implementation’ section, this could not be accomplished in the development timeframe. In terms of the design of the simulation, it was decided that it should be kept very simple, by just displaying the sprite, which would stand out clearly from the background, and the containing window itself. The screenshot below shows the fairly crude, yet clear, sprite that would be the focal point of the programming in the simulation:
  • 11. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 8 Image: Visual Basic Simulation Program
  • 12. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 9 Implementation The Tutorials The two tutorial programs, as mentioned in the previous ‘Design’ section, were both developed in Visual Studio 2010, in the Visual Basic language, with the primary goal of providing a concise learning guide for users who have no, or a basic, understanding of programming. For effective and clear development, all interactive items within the programs were assigned with appropriate and descriptive names, such as ‘btnTutorialOne’ for the button that navigates the user to the first tutorial, and ‘FileToolStripMenuItem’ for the drop-down menu titled as ‘File’. As also mentioned in the ‘Design’ portion of this report, each tutorial program was to offer its information in a divided, or segmented, style, so as to not intimidate or confuse users with too much information at once. This was accomplished by developing a windows application with six separate windows, one for the main switchboard and the rest for the five tutorial segments, which were all ‘hidden’ on start-up, save for the main switchboard. On the main switchboard, six clear buttons were created and organized vertically, which offer users the ability to exit the program, by using a simple ‘Me.Close()’ command, or navigate to any given tutorial by ‘hiding’ the current window and ‘showing’ the requested one. As the program was designed to only allow for the display of one window at a time, this method of hiding and showing whichever window was currently visible proved an effective method of showing the user only what they had requested at a given time, and was consistently used throughout both tutorial programs, as both share the same framework and functionality. For example, the ‘Next’ and ‘Previous’ buttons simply hide the current window and show the next or previous tutorial windows in the sequence. Additionally, this method is used within the second of the two menu strip items, which provides the users with an alternative method of navigation. The first menu strip item, labelled as ‘File’, offers only an ‘Exit’ option, but additional options could be added in the future, such as help files or a user guide, if the tutorial program was to be expanded. To display the content of each tutorial, rich text boxes were implemented in order to accommodate large portions of text, which could be sufficiently formatted. Formatting in tutorials is important, particularly in the case of programming, as all coding needs to be made distinct and easily visible. To enhance the visibility of the core content of each tutorial chapter, the default font size of 8 was increased to 10, which, when tested on both 1920x1080 and 1280x1024 resolution monitors, was felt to be an appropriate size. The population of the two tutorial programs occurred after the completion of both the Arduino and simulation programs, as it was deemed wise to wait until the content of the tutorials were assured, as if the tutorials were written before the evaluative code could be tested, then valuable development time could have been wasted. However, upon completion of the two primary applications, the population of the tutorials was fairly simple, and was accomplished by right-clicking on the rich text box of each tutorial chapter and inputting the pre-written tutorial text.
  • 13. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 10 The complete source code for both tutorials can be found in Appendix D. Arduino Programming Image: ‘Makeblock Robot Starter Kit’ including the Arduino circuit board. The Arduino robot is programmed in a variant of C++, with its own custom libraries of code syntax, through its partner software package, which provides users with the facilities that allow them to write, verify and upload code to the Arduino circuit- board, via a Micro-USB to USB cable. In the case of this project, a ‘Makeblock Robot Starter Kit’, pictured above, was utilized, which provided an assortment of components that are connected to an Arduino robot circuit board, including an ultrasonic ranger sensor, an infra-red remote controller and receiver, and two-wheel drive functionality with a left and right motor. Out of the features listed above only the infra-red controller, infra-red sensor and motors were utilized in order to carry out the four aforementioned tasks:  Moving forwards and backwards.  Moving along a square-shaped perimeter.  Moving along a triangle-shaped perimeter.  Performing a complete circle of movement. The above tasks were programmed largely by applying pre-determined speed values to each of the motors, depending on the desired movement. In the case of moving forward, a positive fixed speed was applied to both motors at once, whereas in the case of moving backwards, a negative fixed speed was applied. This was utilized in the ‘ForwardAndBackwards’ function shown below: void ForwardAndBackFunction()
  • 14. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 11 { MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(-moveSpeed); MotorR.run(-moveSpeed); delay(1000); } A delay of 1000 milliseconds was applied at the end of each command so that the ‘moveSpeed’ value being applied to each motor could occur for one whole second at a time, before allowing the program to proceed with the next instruction. For the three further tasks, the specified shaped perimeters would require the Arduino robot to turn in order to travel along the desired ‘path’. This was accomplished by applied different speed values to each motor, with the lower value indicating the direction the robot will turn. For example, if the robot was to turn right, then the greater speed would be applied to the left motor, to swing that side of the robot around. To accomplish all of the remaining tasks, the Arduino robot was required to turn by, or by multiplications of, 45 degrees. Through trial and error, it was determined that, at a ‘moveSpeed’ value of 78, a delay of 650 milliseconds was roughly correct. Unfortunately the accuracy of this speed and delay pairing differs greatly depending on the slope of the flooring beneath the robot, though these values were accurate enough to conduct primary research with. To program the Arduino robot to travel along a square-shaped perimeter, a ‘while’ loop was created, which would move the robot forward for one second, turn it by 90 degrees, and increment a loop counter, initially set at 0, until the loop counter reached 4. This would cause the function to end, and allow the robot to be ready for another function. To travel along a triangle-shaped perimeter, the robot would have to turn by 45 degrees, move forward, turn 90 degrees, move forward again, turn 135 degrees, and move forward a final time. Unfortunately, this could not be looped efficiently, so a simple sequence of instructions was implemented. Lastly, for the circular movement, two different, positive movement speeds were applied to the two motors, one being set to travel at a speed of 10, while the other moved at the regular speed of 78. As one motor was able to travel faster than the other, it was then possible for the Arduino to turn. A large delay of 5500 milliseconds was applied, after testing, to ensure that the robot would travel in a full circle. To allow for interaction with the robot via the infra-red (IR) controller, a series of case statements were constructed near the start of the program, so that when a particular button of the infra-red controller was pressed, a corresponding function would be called. For example, in the following segment of code, the function that moves the Arduino along a square-like path is called when the user pressed the ‘2’ button on the controller: case IR_BUTTON_2: SquareFunction(); break; The complete Arduino robot code can be found in Appendix A.
  • 15. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 12 Simulation Programming Initial research into how to accomplish the previously decided tasks in C++ concluded that the most effective way of programming image-based sprites would be to employ ‘Simple DirectMedia Layer’ (SDL), a ‘cross-platform development library designed to provide low level access to audio, keyboard, mouse, joystick, and graphics hardware via OpenGL and Direct3D.’ (SDL, 2016). This would provide access to necessary window creation and image rendering functionality, which could be used to display a sprite as a surface layer graphic, which could then be programmed with pre- determined movement. In order to setup SDL, specifically SDL 2.0, to the point of it being usable in Visual Studio 2010, numerous changes were required to the properties of the existing C++ project. The provided dependant SDL libraries had to be specifically included as approved directories for the project, in order to allow access to the necessary syntax. As a complete beginner to SDL, online sources were researched in order to acquire an effective basis for the simulator program. An appropriate keyboard-based sprite movement program in SDL 2.0 was discovered on Programmer’s Ranch (D'Agostino, 2014), a programming blog which offers C++ tutorials. This particular source of code demonstrated the creation of the window, loading a sprite, setting the background colour of the window, keyboard input events, which moved the sprite, and the refreshing of the window to re-render the sprite if its location changes. This code was edited so that it instead provided a window of an 800x600 resolution, with a black background to help accentuate the developed star-shaped sprite, as well as move the sprite by a set amount of pixels in a given direction when a key on the keyboard is pressed, as opposed to continuously incrementing the amount of pixels for as long as the key is held down for (See Appendix B). Unfortunately, this was the extent of the progress made with using C++ and SDL, as any further development would have required a significant dedication of time, which simply was not available, because of this, it was decided that a switch to Visual Basic should be made, in order to build a more satisfactory program in the remaining time. Prior experience with Visual Basic provided confidence in programming a sprite- based simulation, as previous projects included using a timer-based system to move sprites according to a tick of a timer. A Visual Basic windows application was developed in Visual Studio 2010, utilizing three primary components, consisting of a timer, a picture box, and the main window itself. The main window was created to contain the picture box, which would display the star sprite, and the timer was set to tick every 100 milliseconds. Due to this switch in implementation method, most of the original set of tasks to be carried out by both mediums had to be changed in the case of the simulation, as the final version of the simulation only allows for three tasks, which exclude tasks of programming the sprite to move in a triangular or circular shape, as the pixel grid-based nature of windows applications limited this, and it would not be a simple task to teach in a short tutorial. These tasks are as follows:  Moving the sprite by a set amount of pixels upwards when clicked on.
  • 16. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 13  Moving the sprite repeatedly up and down upon running the simulation.  Moving the sprite along a square-like perimeter. To accomplish the first task of the above list, a simple sub-routine that subtracts 50 pixels from the distance between the top of the window and the star sprite, when clicked on, was sufficient. The later tasks required the use of a ‘Time’ integer, which would increase in value with every tick of the timer component on the primary window. With each tick of the timer, so every 100 milliseconds, 10 would be added to the current value stored in the ‘Time’ integer. In the case of the square path task, as long as the time integer was less than or equal to 20, 50 pixels would be added to the distance between the left side of the window and the sprite, thereby moving the sprite right. When the ‘Time’ integer stored a value between 20 and 40, the sprite would move down. This same practice was used to move the sprite along the two remaining sides, as well. The full source code for the Visual Basic simulation program can be found in Appendix C.
  • 17. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 14 Project Management Most project management processes were applied as part of the preliminary documentation supplied before the project could be wholly conducted, within the action plan. These processes included a risk assessment, an identification of necessary resources, as well as a project plan, constructed as a Gantt chart. Change Control & Change Management As this project was undertaken without requirements determined by a given client, traditional processes of change control and change management, in relation to a change in the client’s requirements, were not necessary. However, there were some significant unforeseen changes to the project’s developmental course, particularly during the development of the simulation, as described previously. When it became apparent that a switch to Visual Basic would be more effective than pursuing and devoting a significant portion of valuable time to learning advanced C++ and SDL coding. Upon this decision, the solution had to be redesigned, and a consideration for the tasks that the new simulation was to be able to complete was required. Due to the shortage of development time remaining, by this point, it was determined that the simulation should be able to accomplish three separate tasks, as described previously. Once these tasks were determined, with a consideration for the appearance of the windows application, the implementation process could be continued until completion.
  • 18. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 15 Testing In order to ensure that no functional faults make an impact during the primary research process, thorough test plans are needed for each application, where were conducted after the implementation phase of the project. Six tables, three for the test plans with expected results and another three for a description of the actual test results, with as well as actions taken, have been listed below. Test Plan - Tutorial Applications Element to be Tested Method of Testing Expected Results Main switchboard navigation buttons for each tutorial chapter Clicking each button to ensure that the user will arrive at the expected location. Clicking on each navigation button will navigate the user to its appropriately labelled tutorial chapter. Main switchboard ‘Exit’ button Clicking the ‘Exit’ button to see if the program completely closes. Clicking on the ‘Exit’ button of the main switchboard will close the program entirely, as opposed to just hiding the present window. ‘File’ menu ‘Exit’ option Clicking the ‘Exit’ option to see if the program completely closes. Clicking on the ‘File’ menu ‘Exit’ option will close the program entirely. ‘Tutorials’ menu item Clicking through each ‘Tutorials’ menu item, to ensure that the user will arrive at the expected location. Clicking on each item of the ‘Tutorials’ drop-down menu will navigate the user to the appropriately labelled tutorial number. Text-based navigation links for the five tutorial chapters Clicking through each text-link, to ensure that the user will arrive at the expected tutorial. Clicking on each text- based navigation link will navigate the user to the appropriately labelled tutorial number. ‘Next’ and ‘Previous’ buttons The ‘Next’ and ‘Previous’ buttons will be clicked through to ensure that the user will arrive at the correct tutorial. These buttons should also be disabled at the last and first tutorial entry, respectively, which will be tested by checking their appearance and by attempting to click on them. Clicking on the ‘Next’ and ‘Previous’ buttons will navigate the user to the next or previous tutorial in the sequence. Additionally, these buttons will be greyed out and disabled on tutorials 1 and 5 respectively. ‘File’ menu ‘Main Menu’ Clicking the ‘Main Menu’ Clicking on the ‘Main
  • 19. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 16 option option under the ‘File’ menu, to ensure that the user will be navigated back to the main menu. Menu’ option under the ‘File’ drop-down menu should navigate the user back to the main switchboard. Additionally, this option should not be displayed on the ‘File’ menu of the main switchboard. Tutorial contents to display The contents will be examined to ensure that the correct tutorial is being displayed for the correct tutorial number and title. Each tutorial will display the appropriate contents for the present tutorial. For example, the first tutorial option should contain the introduction to the Arduino robot, or the simulation, depending on the tutorial. Test Results - Tutorial Applications Element Tested Method of Testing Used Actual Results Actions Taken Main switchboard navigation buttons for each tutorial chapter Clicking each button to ensure that the user will arrive at the expected location. As expected. None needed. Main switchboard ‘Exit’ button Clicking the ‘Exit’ button to see if the program completely closes. As expected. None needed. ‘File’ menu ‘Exit’ option Clicking the ‘Exit’ option to see if the program completely closes. As expected. None needed. ‘Tutorials’ menu item Clicking through each ‘Tutorials’ menu item, to ensure that the user will arrive at the expected location. As expected. None needed. Text-based navigation links for the five tutorial chapters Clicking through each text-link, to ensure that the user will arrive at the expected tutorial. As expected. None needed. ‘Next’ and The ‘Next’ and As expected. None needed.
  • 20. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 17 ‘Previous’ buttons ‘Previous’ buttons will be clicked through to ensure that the user will arrive at the correct tutorial. These buttons should also be disabled at the last and first tutorial entry, respectively, which will be tested by checking their appearance and by attempting to click on them. ‘File’ menu ‘Main Menu’ option Clicking the ‘Main Menu’ option under the ‘File’ menu, to ensure that the user will be navigated back to the main menu. As expected. None needed. Tutorial contents to display The contents will be examined to ensure that the correct tutorial is being displayed for the correct tutorial number and title. As expected. None needed. Test Plan - Arduino Program Element to be Tested Method of Testing Expected Results Function which moves the Arduino robot forwards and backwards when the ‘1’ button is pressed on the IR controller. Pressing the ‘1’ button on the controller to see if the function is executed correctly. The Arduino robot will move forwards for one second, stop, and then reverse for an additional section. Function which moves the Arduino robot along a square-shaped path when the ‘2’ button is pressed on the IR controller. Pressing the ‘2’ button on the controller to see if the function is executed correctly. The Arduino robot will move forwards for one second, turn clockwise by 90 degrees, and then repeat these two actions an additional three times, to return itself to its starting position. Function which moves the Arduino robot along a Pressing the ‘3’ button on the controller to see if the The Arduino will turn 45 degrees clockwise, move
  • 21. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 18 triangle-shaped path when the ‘3’ button is pressed on the IR controller. function is executed correctly. forward for a second, turn 90 degrees, move forward, turn 135 degrees and then move forward a final time, to return to its starting position. Function which moves the Arduino robot in a full circle when the ‘4’ button is pressed on the IR controller. Pressing the ‘4’ button on the controller to see if the function is executed correctly. The Arduino robot’s left motor will run at a faster speed than its right, and will turn a full 360 degrees. Test Results - Arduino Program Element Tested Method of Testing Used Actual Results Actions Taken Function which moves the Arduino robot forwards and backwards when the ‘1’ button is pressed on the IR controller. Pressing the ‘1’ button on the controller to see if the function is executed correctly. As expected. None needed. Function which moves the Arduino robot along a square-shaped path when the ‘2’ button is pressed on the IR controller. Pressing the ‘2’ button on the controller to see if the function is executed correctly. As expected. None needed. Function which moves the Arduino robot along a triangle-shaped path when the ‘3’ button is pressed on the IR controller. Pressing the ‘3’ button on the controller to see if the function is executed correctly. As expected. None needed. Function which moves the Arduino robot in a full circle when the ‘4’ button is pressed on the IR controller. Pressing the ‘4’ button on the controller to see if the function is executed correctly. The robot only travelled for about half of the circle. The delay value was increased, to extend the amount of time that the speed values would be applied to each motor. This value was increased from 2600 to 5500, which proved
  • 22. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 19 appropriate. Test Plan - Visual Basic Simulation Program Element to be Tested Method of Testing Expected Results Task which moves the sprite by a set amount of pixels upwards when clicked on. Running the program in debug mode and clicking on the star sprite, to see if it moves by the determined amount of pixels. When the program is started, if all other tasks have been commented out or have been removed, the sprite, when clicked on, will move 50 pixels upwards. Task which moves the sprite repeatedly up and down upon running the simulation. Running the program in debug mode and seeing whether the sprite repeatedly moves up and down until the program is closed. When the program is started, if the square- perimeter task is not enabled, the sprite will immediately and repeatedly move downwards and then upwards. Task which moves the sprite along a square-like perimeter. Running the program in debug mode and seeing whether the sprite repeatedly moves in a ‘clockwise’ square until the program is closed. When the program is started, if the ‘up and down’ task is disabled, the sprite will immediately and repeatedly move along a square-shaped perimeter, beginning with moving to the right, and then down. Test Results - Visual Basic Simulation Program Element Tested Method of Testing Used Actual Results Actions Taken Task which moves the sprite by a set amount of pixels upwards when clicked on. Running the program in debug mode and clicking on the star sprite, to see if it moves by the determined amount of pixels. As expected. None needed. Task which moves the sprite repeatedly up and down upon running the simulation. Running the program in debug mode and seeing whether the sprite repeatedly moves up and down until the program is As expected. None needed.
  • 23. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 20 closed. Task which moves the sprite along a square-like perimeter. Running the program in debug mode and seeing whether the sprite repeatedly moves in a ‘clockwise’ square until the program is closed. As expected. None needed.
  • 24. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 21 The Primary ResearchProcess Research Plan In order to ensure that the research conducted is effective and completed in a timely manner, several key elements of the research process were pre-determined. By the time of completion of the implementation and testing phases of the project, the opportunity of conducting the project research on a large group of subjects had passed, and only a small sample size of computing students could be guaranteed for participation. Because of this, it was decided that each student should test through both the Arduino robot and Visual Basic simulation exercises. In terms of how the data would be collected, it was decided that primary data collection would be best done through survey documents that the research subjects would be encouraged to complete after they had completed the tasks set by the two tutorials. Each survey document requested basic information about the user, such as age, gender and occupation, so that it would be possible to analyse other correlations across the data. In terms of quantitatively evaluable questions, the following questions were presented as the first part of each survey, which could be answered with either: ‘Not effective at all’, ‘Not very effective’, ‘Somewhat effective’, ‘Effective’, or ‘Very effective’. Simulation-Based Program: 1. Do you feel that the simulation was an effective medium for learning basic programming? 2. How effective do you think the simulation would be in teaching you programming without the aid of a human teacher? 3. How effective would the addition of a human teacher be when learning through this medium? Robotics-Based Program: 1. Do you feel that the Arduino robot was an effective medium for learning basic programming? 2. How effective do you think the Arduino robot would be in teaching you programming without the aid of a human teacher? 3. How effective would the addition of a human teacher be when learning through this medium? In terms of qualitatively evaluable questions, the following questions were presented as the later part of each survey: 1. Which aspects did you particularly like from either medium? 2. Which aspects did you particularly dislike from either medium? 3. What suggestions would you make to improve either medium? 4. Which medium would you personally prefer to use for learning programming?
  • 25. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 22 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 1. Do you feel that the simulation was an effective medium for learning basic programming? Effectiveness of the Simulation Number of Responses 5. Which medium would you recommend to beginner programmers, provided that both were available to them? An ‘Other Comments’ section was also provided at the end of each survey, in case any users had additional points that they would like to raise, which couldn’t be used in response to any of the above questions. The survey template can be found in Appendix F, while the completed surveys of the acquired research subjects can be found in Appendix G. Quantitative Results
  • 26. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 23 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 2. How effective do you think the simulation would be in teaching you programming without the aid of a human teacher? Effectiveness of the Simulation without a Human Teacher Number of Responses 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 3. How effective would the addition of a human teacher be when learning through this medium? Effectiveness of the Simulation with a Human Teacher Number of Responses
  • 27. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 24 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 2. How effective do you think the Arduino robot would be in teaching you programming without the aid of a human teacher? Effectiveness of the ArduinoRobot without a Human Teacher Number of Responses 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 1. Do you feel that the Arduino robot was an effective medium for learning basic programming? Effectiveness of the ArduinoRobot Number of Responses
  • 28. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 25 0 1 2 3 4 5 Not effective at all Not very effective Somewhat effective Effective Very effective 3. How effective would the addition of a human teacher be when learning through this medium? Effectiveness of the ArduinoRobot with a Human Teacher Number of Responses Qualitative Results Question Response(s) Which aspects did you particularly like from either medium?  It’s easy to see whether you’ve programmed it correctly or not, since the movement of the items provides feedback.  Was able to relate to the robot with prior knowledge about wheel speeds in order to determine direction  They were both visual so students can see results easily.  With the simulation piece it was very accessible from point of view that testing was very quick as opposed to plugging in the robot. Which aspects did you particularly dislike from either medium?  Unorthodox way of teaching programming, doesn’t really cover basic practices like variable declaration, different variable
  • 29. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 26 scopes, etc. Mainly teaches loops/functions.  Simulation software was very basic and lacked simple graphics.  The copy and paste nature of the tutorial I feel stunted the learning. What suggestions would you make to improve either medium?  Give the user more responsibility for creating the rest of the program, since they’ll have no idea what’s going on.  Could have had some colour to the tutorials to engage more?  Link the simulation and tutorials into one software  Add some flow diagrams of the procedures  Perhaps the addition of “broken programming” for bug testing. Which medium would you personally prefer to use for learning programming?  The simulation is simpler than the robot, which has greater potential for confusion.  The robot.  The Arduino.  Robotics based programing. Which medium would you recommend to beginner programmers, provided that both were available to them?  The simulation first, then the robot once they had that figured out.  I believe the simulation based program is easier to understand, however the robot to be more engaging.  Simulation  Simulation based program, was much simpler. Other Comments  “The first question of the robotics-based program survey should ask how effective the medium is at teaching programming concepts and syntax.
  • 30. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 27 Results Analysis Although a small sample size, the data collected throughout the research process shows a clear difference in opinion even across a select group of fellow Bachelor of Science students, with many of the surveyed questions yielding responses across three to four of the five possible answers in the case of the quantitative. Additionally, a good variety of qualitative comments were also provided, which is particularly helpful in research projects such as this. In terms of the general effectiveness of each learning medium, the test group responded similarly across both, though the data retrieved shows a slight favourability towards the Arduino robot, with one user stating that the Arduino robot was a ‘very effective’ medium for learning basic programming. The next pairing of questions, asked to gather opinions on how effective each medium would be without the aid of a human teacher, showed an average level of effectiveness across the test group, though with a clear divide in opinion on the Arduino, with half the group stating that the Arduino would be ‘effective’. The other half, on the other hand, stated that the Arduino would either be ‘not effective at all’ or ‘not effective’. Generally, the data shows that the test group has a more consistent opinion on the effectiveness of the simulation, in this case. For the final pairing of questions, discussing the effectiveness of either medium with the aid of a human teacher, showed very consistent results, with both questions only receiving strongly positive answers. The data collected indicates that the entirety of the sample group believe that both mediums would be ‘effective’ or ‘very effective’ with the aid of a teacher, who would be able to answer queries and provide overall guidance. The qualitative responses yielded from the first of such questions described a liking for the visual aspect of each medium as it would be clear whether the robot or the simulation had been programmed correctly, due to the timely nature of visual feedback, perhaps indicating a slight lean towards a preference of the visual learning style across the sample group. Additionally, one student found the robot relatable in terms of their understanding of real physics, which aided in their learning. Another student expressed a liking for the accessibility of the simulation, over the robot, as there was little wait time between creating the program and seeing it in effect, whereas with the robot, users would have to connect it, verify the code, upload the code, unplug the robot, set it down on an open space and then communicate a function to it. In terms of what the test group disliked from either medium, one commented on the lack of information of some basic programming principles and practices, such as variable declaration and scopes. Other test users stated a dislike for the basic nature of the simulation application, which lacked some simple graphics that would have improved its appearance. Lastly, a user described a dislike for the ‘copy and paste nature’ of the tutorial programs, in the sense that it provided all the coding necessary to complete each stated task, without leaving any room for the learner to figure out the necessary code themselves.
  • 31. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 28 Numerous areas of improvement were also identified by the test users, including an important change regarding providing users with more responsibility in terms of getting the program to work, providing necessary information while not providing all of the answers, this relates to the previous ‘copy and paste’ point of displeasure mentioned above. In a similar response, it was suggested that the addition of ‘broken programming’ would be an effective method of teaching students, as it would encourage them to find out what’s wrong with each piece of code, enforcing productive learning. Another user commented that the appearance of the programs could be more appealing, which could lead to them being more engaging, and another suggested that the tutorials could have included flow-charts of the procedures undertaken in each program, adding an additional visual element for those who are particularly inclined towards that learning style. On a personal level, the majority of the test group states that they would prefer to learn programming through the robotics-based medium. However, for beginner programmers, they universally suggest that the simulation would be more appropriate, from which they can move onto studying with the Arduino robot, once a suitable level of programming understanding had been acquired. Information regarding the age, occupation and gender of each user was also collected via the survey, though this held little bearing within such a small and common research sample, as all test users were of a similar age, ranging between 22 and 26 years old. Additionally, only the male gender was represented in the research collected above thus leaving no point of comparison between genders. On the scale of national education, these additional points of data comparison would have significant bearing, as it would be critical to identify whether those of different age groups or genders have particular educational leans in terms of learning mediums. The most consistent opinions collected through this primary research process include the description of a clear benefit to the presence of teachers in learning environments, indicating that, at least in terms of the quality of education the two provided mediums could supply, robotics and simulations cannot entirely replace qualified human assistance in places of learning. This indicative need for teachers in the learning environment is consistent with the research conducted as part of the preliminary literature review, stating that, in addition to providing direct instruction, the teacher is also required to take on ‘a “technical” support role’, which would be particularly true within technology-based subjects.
  • 32. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 29 Conclusion Due to the comparatively small sample size of test users, the primary research results displayed above are altogether inconclusive, though they do show some consistent opinions across individuals who are already greatly experienced in educational computing. These consistent opinions mostly lie in the recommendations of using the simulation to teach complete beginners, the improvement in learning that qualified teachers provide, and a personal preference, across most Bachelor of Science computing students, to continue their learning through the robotics-based medium. However, the questions above that yielded a great diversity of responses show that a preference in learning styles and mediums will typically depend greatly on the individual learner. This shows some weakness in the originally proposed research question, as any answer provided would not represent the preferences of every student. Humans, by nature, have distinct differences in how they progress, and by which methods they can best expand their knowledge and proficiency in particular subject areas. In an ideal world, the most effective way of providing programming education would be to provide all possible learning mediums to each and every student, so that any student at any time would be able to receive the most benefit to their learning. However, in reality, costs and organizational difficulties of supplying each student with their own robot, for example, make this an unlikely luxury in the present; therefore, greater sample sizes for primary research processes, as undertaken in this project, is required in order to determine which methods the majority of students prefer, in hopes to determine the most effective course of action for the education sector to take. Future Developments Some responses gathered through the research process show a weakness in the appearance and functionality of the simulation-based program, as well as the structure and delivery of the exercises provided in the tutorials. This indicates that improvement across both criticised applications would be required in order to bring them to a professional level for the conduction of wider research, as quality of these applications could have a negative impact on the opinions of students if either medium is not represented well. With additional development time, the functionality of the simulation would be a priority, in terms of the tasks that it can achieve, as it should be able to demonstrate the accomplishment of the same functions as the robot. After the completion of these improvements, a greater scale of research groups, with individuals of varying abilities, would provide additional credibility to the concluding thoughts of the project. Alternative angles of research can also be applied within the project for the future, such as sample groups including ‘disadvantaged students’, for which, when tested, the ‘effects of CBT (Computer-Based Teaching) … were stronger’ (Bangert-Drowns et al., 1985).
  • 33. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 30 Personal Evaluation Throughout the course of the project, numerous skills, both existing and new, were practiced and acquired, respectively, particularly due to inexperience in programming robots, constructing tutorials, and developing simulations. The primary existing skills that experienced a great deal of practice and development include the construction of academic documents, the citation of more diverse sources, project management processes, human-computer interaction principles, Visual Basic and C++ programming, testing procedures, and critical analysis. However, in terms of the practical capability of the developed applications, while adequate for the purposes of this primary research project, would require additional development in order to be suitable for study conducted on a national level, or within professional institutions. Despite the shortcomings of the developed mediums, they provided an opportunity to engage in new areas of programming, such as utilizing the SDL library and more advanced implementations of C++, in addition to utilizing new features of windows applications. The project also provided an opportunity to gain some experience in conducting research surveys and the collection of primary data, which has been valuable, despite the small research sample size of students. This small research group is an additional weakness of the project, and was caused primarily due to the slow development of the programming applications. As development of the applications came to a close, there was little time remaining to organize the originally desired test groups, and thus the findings of the project were of an overall lower quality than initially hoped. Overall, I believe that a combination of both new skills and existing skills saw a great deal of progress, and I am presently confident in my ability to produce professional- level documentation.
  • 34. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 31 References Bangert-Drowns,R.L.,Kulik,J.A.&Kulik,C.-l.C.,1985. Effectivenessof computer-based education in secondary schools. Catlin,D..B.M.,2012. The Principles of EducationalRoboticApplications(ERA):A framework forunderstanding and developing educationalrobotsand theiractivities.ValiantTechnology Ltd, CanterburyChristChurchUniversity. Cooper,M..K.D..H.W..D.K.,1999. Robotsin the Classroom - Toolsfor AccessibleEducation. Reading,UK:OpenUniversity,Universityof Reading. D'Agostino,D.,2014. SDL2: Keyboard and MouseMovement(Events).[Online]Available at: http://programmersranch.blogspot.co.uk/2014/02/sdl2-keyboard-and-mouse-movement- events.html[Accessed1April 2016]. LarsTech,2014. Moving PictureBox using Timer. [Online] Available at: http://stackoverflow.com/questions/22666555/moving-picturebox-using-timer[Accessed April 2016]. SDL, 2016. AboutSDL.[Online]Available at:https://www.libsdl.org/ [Accessed10May 2016]. Storer,J.,2016. Action Plan forResearch Project.Bath: Bath College.
  • 35. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 32 Appendix Appendix A: Complete Arduino Exercise Source Code /**************************************************************************/ #include <Makeblock.h> #include <Arduino.h> #include <SoftwareSerial.h> #include <Wire.h> MeDCMotor MotorL(M1); MeDCMotor MotorR(M2); MeInfraredReceiver infraredReceiverDecode(PORT_6); int moveSpeed = 78; boolean leftflag,rightflag; int minSpeed = 10; int LoopNumber = 0; // int factor = 23; void setup() { infraredReceiverDecode.begin(); } void loop() { if(infraredReceiverDecode.available()||infraredReceiverDecode.buttonState()) { switch(infraredReceiverDecode.read()) { case IR_BUTTON_PLUS: Forward(); break; case IR_BUTTON_MINUS: Backward(); break; case IR_BUTTON_NEXT: TurnRight(); break; case IR_BUTTON_PREVIOUS: TurnLeft(); break; case IR_BUTTON_1: ForwardAndBackFunction(); break; case IR_BUTTON_2: SquareFunction(); break; case IR_BUTTON_3: TriangleFunction(); break; case IR_BUTTON_4:
  • 36. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 33 CircleFunction(); break; case IR_BUTTON_5: FunctionFive(); break; case IR_BUTTON_6: FunctionSix(); break; case IR_BUTTON_7: FunctionSeven(); break; case IR_BUTTON_8: FunctionEight(); break; case IR_BUTTON_9: FunctionNine(); break; } } else { Stop(); } } void Forward() { //Move forward for one second MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); } void Backward() { MotorL.run(-moveSpeed); MotorR.run(-moveSpeed); delay(1000); } void TurnLeft() { MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(650); } void TurnRight() { MotorL.run(-moveSpeed); MotorR.run(moveSpeed); delay(650); } void Stop()
  • 37. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 34 { MotorL.run(0); MotorR.run(0); } void ChangeSpeed(int spd) { moveSpeed = spd; } void ForwardAndBackFunction() { MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(-moveSpeed); MotorR.run(-moveSpeed); delay(1000); } void SquareFunction() { while (LoopNumber != 4) { MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(650); LoopNumber++; } } void TriangleFunction() { MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(325); MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(650); MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(975);
  • 38. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 35 MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); } void CircleFunction() { MotorL.run(moveSpeed); MotorR.run(minSpeed); delay(5500); }
  • 39. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 36 Appendix B: Complete Simulation Exercise Source Code – C++ & SDL #include <SDL.h> int main(int argc, char ** argv) { bool Quit = false; SDL_Event event; int x = 360; int y = 240; SDL_Init(SDL_INIT_VIDEO); SDL_Window * window = SDL_CreateWindow("Simulator Program - C++ & SDL", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 800, 600, 0); SDL_Renderer * renderer = SDL_CreateRenderer(window, -1, 0); SDL_Surface * image = SDL_LoadBMP("Star.bmp"); SDL_Texture * texture = SDL_CreateTextureFromSurface(renderer, image); SDL_FreeSurface(image); SDL_SetRenderDrawColor(renderer, 0, 0, 0, 0); while (!Quit) { switch (event.type) { case SDL_QUIT: Quit = true; break; case SDL_KEYDOWN: switch (event.key.keysym.sym) { case SDLK_1: x-=4; break; case SDLK_2: x+=4; break; case SDLK_3: y-=4; break; case SDLK_4: y+=4; break; }
  • 40. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 37 break; } SDL_Rect dstrect = {x, y, 75, 75}; SDL_RenderClear(renderer); SDL_RenderCopy(renderer, texture, NULL, &dstrect); SDL_RenderPresent(renderer); } SDL_DestroyTexture(texture); SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); return 0; }
  • 41. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 38 Appendix C: Complete Simulation Exercise Source Code – VB Public Class VBSimulator Private Sub StarSprite_Click(sender As System.Object, e As System.EventArgs) Handles StarSprite.Click StarSprite.Top -= 50 End Sub Private Time As Integer Private Sub MovementTimer_Tick(sender As System.Object, e As System.EventArgs) Handles MovementTimer.Tick Time += 10 'Moving the sprite up and down. ' If Time <= 20 Then 'StarSprite.Top += 50 ' ElseIf Time > 20 AndAlso Time <= 40 Then ' StarSprite.Top -= 50 'Else ' Time = 0 ' End If ' Moving the Sprite along a square path. ' If Time <= 20 Then ' StarSprite.Left += 50 ' ElseIf Time > 20 AndAlso Time <= 40 Then ' StarSprite.Top += 50 ' ElseIf Time > 40 AndAlso Time <= 60 Then ' StarSprite.Left -= 50 ' ElseIf Time > 60 AndAlso Time <= 80 Then ' StarSprite.Top -= 50 ' Else ' Time = 0 ' End If End Sub End Class
  • 42. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 39 Appendix D: Arduino and Simulation Tutorial Source Code Main Switchboard Public Class MainSwitchboard Private Sub btnTutorialOne_Click(sender As System.Object, e As System.EventArgs) Handles btnTutorialOne.Click TutorialOne.Show() Me.Hide() End Sub Private Sub btnTutorialTwo_Click(sender As System.Object, e As System.EventArgs) Handles btnTutorialTwo.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub btnTutorialThree_Click(sender As System.Object, e As System.EventArgs) Handles btnTutorialThree.Click TutorialThree.Show() Me.Hide() End Sub Private Sub btnTutorialFour_Click(sender As System.Object, e As System.EventArgs) Handles btnTutorialFour.Click TutorialFour.Show() Me.Hide() End Sub Private Sub btnTutorialFive_Click(sender As System.Object, e As System.EventArgs) Handles btnTutorialFive.Click TutorialFive.Show() Me.Hide() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click TutorialOne.Show() Me.Hide() End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click TutorialTwo.Show() Me.Hide()
  • 43. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 40 End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click TutorialThree.Show() Me.Hide() End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click TutorialFour.Show() Me.Hide() End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click TutorialFive.Show() Me.Hide() End Sub Private Sub btnExit_Click(sender As System.Object, e As System.EventArgs) Handles btnExit.Click TutorialOne.Close() TutorialTwo.Close() TutorialThree.Close() TutorialFour.Close() TutorialFive.Close() Me.Close() End Sub Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click TutorialOne.Close() TutorialTwo.Close() TutorialThree.Close() TutorialFour.Close() TutorialFive.Close() Me.Close() End Sub End Class
  • 44. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 41 Tutorial One Public Class TutorialOne Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click MainSwitchboard.Close() TutorialTwo.Close() TutorialThree.Close() TutorialFour.Close() TutorialFive.Close() Me.Close() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click TutorialThree.Show() Me.Hide() End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click TutorialFour.Show() Me.Hide() End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click TutorialFive.Show() Me.Hide() End Sub Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialOne.LinkClicked
  • 45. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 42 End Sub Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialTwo.LinkClicked TutorialTwo.Show() Me.Hide() End Sub Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialThree.LinkClicked TutorialThree.Show() Me.Hide() End Sub Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFour.LinkClicked TutorialFour.Show() Me.Hide() End Sub Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFive.LinkClicked TutorialFive.Show() Me.Hide() End Sub Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click TutorialFive.Show() Me.Hide() End Sub Private Sub btnMainMenu_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click MainSwitchboard.Show() Me.Hide()
  • 46. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 43 End Sub Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MainMenuToolStripMenuItem.Click MainSwitchboard.Show() Me.Hide() End Sub End Class
  • 47. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 44 Tutorial Two Public Class TutorialTwo Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click End Sub Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click TutorialOne.Close() MainSwitchboard.Close() TutorialThree.Close() TutorialFour.Close() TutorialFive.Close() Me.Close() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click TutorialOne.Show() Me.Hide() End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click TutorialThree.Show() Me.Hide() End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click TutorialFour.Show() Me.Hide() End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click TutorialFive.Show() Me.Hide() End Sub
  • 48. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 45 Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialOne.LinkClicked TutorialOne.Show() Me.Hide() End Sub Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialTwo.LinkClicked End Sub Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialThree.LinkClicked TutorialThree.Show() Me.Hide() End Sub Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFour.LinkClicked TutorialFour.Show() Me.Hide() End Sub Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFive.LinkClicked TutorialFive.Show() Me.Hide() End Sub Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click TutorialThree.Show() Me.Hide() End Sub Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click TutorialOne.Show() Me.Hide() End Sub
  • 49. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 46 Private Sub btnMainMenu_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click MainSwitchboard.Show() Me.Hide() End Sub Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MainMenuToolStripMenuItem.Click MainSwitchboard.Show() Me.Hide() End Sub End Class
  • 50. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 47 Tutorial Three Public Class TutorialThree Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click End Sub Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click TutorialOne.Close() TutorialTwo.Close() MainSwitchboard.Close() TutorialFour.Close() TutorialFive.Close() Me.Close() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click TutorialOne.Show() Me.Hide() End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click TutorialFour.Show() Me.Hide() End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click TutorialFive.Show() Me.Hide()
  • 51. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 48 End Sub Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialOne.LinkClicked TutorialOne.Show() Me.Hide() End Sub Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialTwo.LinkClicked TutorialTwo.Show() Me.Hide() End Sub Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialThree.LinkClicked End Sub Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFour.LinkClicked TutorialFour.Show() Me.Hide() End Sub Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFive.LinkClicked TutorialFive.Show() Me.Hide() End Sub Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click TutorialFour.Show() Me.Hide() End Sub Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click TutorialTwo.Show() Me.Hide()
  • 52. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 49 End Sub Private Sub btnMainMenu_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click MainSwitchboard.Show() Me.Hide() End Sub Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MainMenuToolStripMenuItem.Click MainSwitchboard.Show() Me.Hide() End Sub End Class
  • 53. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 50 Tutorial Four Public Class TutorialFour Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click End Sub Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click TutorialOne.Close() TutorialTwo.Close() TutorialThree.Close() MainSwitchboard.Close() TutorialFive.Close() Me.Close() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click TutorialOne.Show() Me.Hide() End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click TutorialThree.Show() Me.Hide() End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click TutorialFive.Show() Me.Hide() End Sub
  • 54. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 51 Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialOne.LinkClicked TutorialOne.Show() Me.Hide() End Sub Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialTwo.LinkClicked TutorialTwo.Show() Me.Hide() End Sub Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialThree.LinkClicked TutorialThree.Show() Me.Hide() End Sub Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFour.LinkClicked End Sub Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFive.LinkClicked TutorialFive.Show() Me.Hide() End Sub Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click TutorialFive.Show() Me.Hide() End Sub Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click TutorialThree.Show() Me.Hide() End Sub
  • 55. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 52 Private Sub btnMainMenu_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click MainSwitchboard.Show() Me.Hide() End Sub Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MainMenuToolStripMenuItem.Click MainSwitchboard.Show() Me.Hide() End Sub End Class Tutorial Five
  • 56. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 53 Public Class TutorialFive Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click End Sub Private Sub ExitToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles ExitToolStripMenuItem.Click TutorialOne.Close() TutorialTwo.Close() TutorialThree.Close() TutorialFour.Close() MainSwitchboard.Close() Me.Close() End Sub Private Sub TutorialOneToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialOneToolStripMenuItem.Click TutorialOne.Show() Me.Hide() End Sub Private Sub TutorialTwoToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialTwoToolStripMenuItem.Click TutorialTwo.Show() Me.Hide() End Sub Private Sub TutorialThreeToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialThreeToolStripMenuItem.Click TutorialThree.Show() Me.Hide() End Sub Private Sub TutorialFourToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFourToolStripMenuItem.Click TutorialFour.Show() Me.Hide() End Sub Private Sub TutorialFiveToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles TutorialFiveToolStripMenuItem.Click End Sub Private Sub linkTutorialOne_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialOne.LinkClicked
  • 57. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 54 TutorialOne.Show() Me.Hide() End Sub Private Sub linkTutorialTwo_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialTwo.LinkClicked TutorialTwo.Show() Me.Hide() End Sub Private Sub linkTutorialThree_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialThree.LinkClicked TutorialThree.Show() Me.Hide() End Sub Private Sub linkTutorialFour_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFour.LinkClicked TutorialFour.Show() Me.Hide() End Sub Private Sub linkTutorialFive_LinkClicked(sender As System.Object, e As System.Windows.Forms.LinkLabelLinkClickedEventArgs) Handles linkTutorialFive.LinkClicked End Sub Private Sub btnNext_Click(sender As System.Object, e As System.EventArgs) Handles btnNext.Click TutorialOne.Show() Me.Hide() End Sub Private Sub btnPrevious_Click(sender As System.Object, e As System.EventArgs) Handles btnPrevious.Click TutorialFour.Show() Me.Hide() End Sub Private Sub btnMainMenu_Click(sender As System.Object, e As System.EventArgs) Handles btnMainMenu.Click MainSwitchboard.Show()
  • 58. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 55 Me.Hide() End Sub Private Sub MainMenuToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) Handles MainMenuToolStripMenuItem.Click MainSwitchboard.Show() Me.Hide() End Sub End Class
  • 59. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 56 Appendix E: Tutorial Contents Arduino Tutorial Tutorial One: The Arduino robot is programmed in a variant of C++, using its own custom library for essential commands. In this exercise, the Arduino robot will be programmed to be controlled by an infra-red (IR) controller. In the blank IR Control program, provided with this tutorial, the infra-red controller is programmed to run specific functions depending on which button is pressed. case IR_BUTTON_1: ForwardAndBackFunction(); break; The above case, for example, will load the ‘ForwardAndBackFunction’ from lower down in the program, which is presently blank. This function will be completed in the following tutorial. For the robot to move, each motor, left and right, must be commanded to run at a certain speed. The speeds required to complete the following activities are defined towards the top of the program, but can be changed at any time: int moveSpeed = 78; int minSpeed = 10; In order to communicate a speed value to each motor, the following command should be used: MotorL.run(moveSpeed); MotorR.run(moveSpeed); In the above example, both motors are being told to run at the speed of 78, or ‘moveSpeed’. However, this would cause them to run for a very brief moment before turning off again. If we want to keep the motors running for 1 second, we can use the ‘delay()’ command, to delay the end of the function for 1 second, written as milliseconds in the program: delay(1000);
  • 60. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 57 Tutorial Two: Now that we understand how to tell the motors to run forward at a given speed, we can also cover how to make them reverse. In order to tell the motors to reverse, we just need to negatively apply the ‘moveSpeed’, as shown below: MotorL.run(-moveSpeed); MotorR.run(-moveSpeed); For the forward and back function, we want to be able to move the robot forward at the given movement speed for one second and then reverse at the same speed for another second. The ‘1’ button on the IR controller is already programmed to initiate the function for this, but it is currently empty. To accomplish this, the ‘ForwardAndBackFunction’ can be populated like so: void ForwardAndBackFunction() { MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(-moveSpeed); MotorR.run(-moveSpeed); delay(1000); } In order to upload this new portion of code to the robot, ensure that the Arduino is connected to the PC and click the ‘Verify’ button at the top left of the Arduino software. This will compile and build the code. Then, if successful, click the ‘Upload’ button beside it. Once the transfer is complete, disconnect the Arduino robot and test the ‘ForwardAndBackFunction’ by pressing the ‘1’ button on the controller. Tutorial Three: The next technique of Arduino programming that we need to learn is how to make the robot turn. To do this, we need to tell the motor of one side to run forwards and the other motor to run backwards. So, applying similar code to that of the previous tutorials, we can turn it by 90 degrees by applying a delay of roughly 650, provided that the original ‘moveSpeed’ value has not been changed. MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(650); The above three lines of code will rotate the robot clockwise by 90 degrees. We can use this, paired with moving forward, to move the robot forward and then rotate it by 90 degrees. This can be repeated four times in order to get the robot to move along a square-like path. In order to efficiently do this, we can use a ‘while’ loop:
  • 61. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 58 void SquareFunction() { while (LoopNumber != 4) { MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(650); LoopNumber++ } } The above section of code says that while our ‘LoopNumber’, set as 0 towards the top of the code, does not equal 4, move the Arduino forward for 1 second and then rotate it by 90 degrees. Once this is done, our ‘LoopNumber’ is incremented, increased by 1, before repeating the process. This continues until our ‘LoopNumber’ reaches 4, which will end the function. The ‘SquareFunction’, by default, will be activated by pressing the ‘2’ button in the controller. Tutorial Four: Much like in the previous tutorials, the task of moving the robot along a triangle- shaped path involves moving forward and rotating but with escalating degrees of rotation, in the case of an equilateral triangle. Initially, the robot must be turned by 45 degrees, assuming it is starting on the bottom-left corner of a standing equilateral triangle, to appropriately lean the first side of the triangle. To turn the robot by 45 degrees, we half the 90 degree delay value applied to the rotation to 325. After this rotation, the robot should travel forward, for 1 second again, before rotating by 90 degrees and moving forward again for another second. Lastly, a final rotation of 135 degrees needs to be made, the code for which is shown below: void TriangleFunction() { MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(325); MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed);
  • 62. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 59 delay(650); MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); MotorL.run(moveSpeed); MotorR.run(-moveSpeed); delay(975); MotorL.run(moveSpeed); MotorR.run(moveSpeed); delay(1000); } } This function is called on by pressing the ‘3’ button on the infra-red controller. Tutorial Five: For the final task of making the robot travel in a full circle, another speed value must be called upon. This second value is determined by the ‘minSpeed’ integer towards the top of the program. By default, this speed is set to 10, which should be applied to the ‘inside’ motor of the turn, while applying the ‘moveSpeed’ value to the ‘outside’ motor: void CircleFunction() { MotorL.run(moveSpeed); MotorR.run(minspeed); delay(2600); } A delay of 2600 milliseconds has been chosen in the example above, and should perform a full clockwise circle, depending on the floor space available. If the floor space is fairly small, a higher speed on the ‘outside’ motor, or a lower speed on the ‘inside’ motor can be applied. This is called upon by pressing the ‘4’ button on the controller. Additional functions have been left unnamed and empty below the example functions for experimentation, but have been attached to the corresponding buttons of the infra- red controller.
  • 63. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 60 Simulator Tutorial Tutorial One: The simulation program provided has been programmed in Visual Basic, used to create a Windows form application. Upon start-up of the program, you’ll see a window titled as ‘Simulator Program – VB [Design]’, a ‘PictureBox’ in the centre which contains a star sprite, and a lower panel that includes a clock icon labelled as ‘MovementTimer’. The star sprite will be the object which we will want to move around the screen, which will be done by attaching movement commands that play out over time. Which movement commands are activated when will be determined by how many ticks of the timer has passed since the start of the program. For windows programs, it is important to bear in mind that the axis is inverted, so vertical pixel-based movements will need to be inverted also. For example, if we want the sprite to move upwards, we would have to tell the sprite to move -50 pixels along the ‘Y’ axis. Tutorial Two: Presently, none of the aforementioned form elements really do anything. In order to apply coding to them, we need to right click on the program in the ‘Solution Explorer’, likely on the right-hand side of the screen, and select ‘View Code’. Presently, the code only contains two sub-routines and a defined integer, ‘Time’, which will be used to determine which movement command takes place and when, along with the ‘Private Sub MovementTimer_Tick…’ sub-routine. The ‘Private Sub StartSprite_Click…’ sub-routine will be a set of instructions which trigger when the sprite is clicked on, which will be expanded upon in the following tutorial. Tutorial Three: In this tutorial, we will populate the ‘StarSprite_Click’ sub-routine, so that the sprite will move upwards when clicked on. In order to do this, we need to enter the following command into the sub-routine: StarSprite.Top -= 50 The ‘StarSprite’ component of the line of code above refers to the object we are moving, and the ‘.top’ portion refers to the distance between the top of the window and the object. The final ‘-= 50’ reduces the existing distance by 50 pixels, therefore moving the image upwards.
  • 64. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 61 Once the above code has been implemented, save the project by using ‘File’ -> ‘Save All’, or CTRL+S, and then run the project in ‘debugging’ mode, by pressing F5 or by clicking the green arrow icon at the top of the application, to test if it works. Tutorial Four: As we are supposed to be simulating movement along set paths, which occur over time, we should now understand how to use the ticks of the ‘MovementTimer’ to communicate which movement commands should occur. The ‘MovementTimer_Tick’ sub-routine will be called upon and executed whenever the timer ticks, which is set to do so every 100 milliseconds. Initially, 10 will be added to the current value stored in the ‘Time’ integer whenever the timer ticks, which will then be used as a point of comparison for the following ‘If’ event: Time += 10 If Time <= 20 Then StarSprite.Top += 50 ElseIf Time > 20 AndAlso Time <= 40 Then StarSprite.Top -= 50 Else Time = 0 End If The ‘If’ event states that if the ‘Time’ value is less than or equal to 20, then add 50 pixels to the distance between the top of the window and the sprite. Otherwise, if the ‘Time’ value becomes greater than 20 but less than or equal to 40, then move the sprite down by 50 pixels. Once the ‘Time’ value reaches above 40, it will then reset the ‘Time’ value to 0, which, being less than 20, would make it move down again. This cycle will repeat until the program is closed. Tutorial Five: For the final task, we want the sprite to move repeatedly along a square path, which can be accomplished by extending the timer-based method used previously to move the sprite up and down. For this, we will need to be able to move the sprite horizontally, or along the ‘X’ axis, which can be done using the following command: StarSprite.Left += 50 The above command will move the sprite 50 pixels to the right, as ‘.Left’ refers to the distance between the image and the left-hand border of the window. So, by extending the timer-based system implemented above, we can move the image along a square path by replacing our old code with the following: Time += 10 If Time <= 20 Then
  • 65. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 62 StarSprite.Left += 50 ElseIf Time > 20 AndAlso Time <= 40 Then StarSprite.Top += 50 ElseIf Time > 40 AndAlso Time <= 60 Then StarSprite.Left -= 50 ElseIf Time > 60 AndAlso Time <= 80 Then StarSprite.Top -= 50 Else Time = 0 End If
  • 66. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 63 Appendix F: Project Program SurveyTemplate Robotics-Based Programming vs. Simulation-Based Programming Survey Age: Gender: Occupation: Simulation-BasedProgram 1. Do you feel that the simulation was an effective medium for learning basic programming? Not effective at all Not very effective Somewhat effective Effective Very effective 2. How effective do you think the simulation would be in teaching you programming without the aid of a human teacher? Not effective at all Not very effective Somewhat effective Effective Very effective 3. How effective would the addition of a human teacher be when learning through this medium? Not effective at all Not very effective Somewhat effective Effective Very effective
  • 67. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 64 Robotics-BasedProgram 1. Do you feel that the Arduino robot was an effective medium for learning basic programming? Not effective at all Not very effective Somewhat effective Effective Very effective 2. How effective do you think the Arduino robot would be in teaching you programming without the aid of a human teacher? Not effective at all Not very effective Somewhat effective Effective Very effective 3. How effective would the addition of a human teacher be when learning through this medium? Not effective at all Not very effective Somewhat effective Effective Very effective
  • 68. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 65 Evaluative Questions 1. Which aspects did you particularly like from either medium? 2. Which aspects did you particularly dislike from either medium? 3. What suggestions would you make to improve either medium? Other Comments 4. Which medium would you personally prefer to use for learning programming? 5. Which medium would you recommend to beginner programmers, provided that both were available to them?
  • 69. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 66 Appendix G: Completed Project Surveys Robotics-Based Programming vs. Simulation-Based Programming Survey Age: 22 Gender: Male Occupation: Student (accounts executive) Simulation-BasedProgram 4. Do you feel that the simulation was an effective medium for learning basic programming? Not effective at all Not very effective Somewhat effective Effective Very effective X 5. How effective do you think the simulation would be in teaching you programming without the aid of a human teacher? Not effective at all Not very effective Somewhat effective Effective Very effective X 6. How effective would the addition of a human teacher be when learning through this medium? Not effective at all Not very effective Somewhat effective Effective Very effective X
  • 70. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 67 Robotics-BasedProgram 4. Do you feel that the Arduino robot was an effective medium for learning basic programming? Not effective at all Not very effective Somewhat effective Effective Very effective X 5. How effective do you think the Arduino robot would be in teaching you programming without the aid of a human teacher? Not effective at all Not very effective Somewhat effective Effective Very effective X 6. How effective would the addition of a human teacher be when learning through this medium? Not effective at all Not very effective Somewhat effective Effective Very effective X
  • 71. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 68 Evaluative Questions 6. Which aspects did you particularly like from either medium? Was able to relate to the robot with prior knowledge about wheel speeds in order to determine direction 7. Which aspects did you particularly dislike from either medium? N/A 8. What suggestions would you make to improve either medium? Could have had some colour to the tutorials to engage more? Other Comments 9. Which medium would you personally prefer to use for learning programming? The robot 10. Which medium would you recommend to beginner programmers, provided that both were available to them? I believe the simulation based program is easier to understand, however the robot to be more engaging
  • 72. Jacob Edward Storer BSc Applied Computing 12/05/2016 Project Report - LP30483 69 Robotics-Based Programming vs. Simulation-Based Programming Survey Age: 26 Gender: Male Occupation: IT Technician Simulation-BasedProgram 7. Do you feel that the simulation was an effective medium for learning basic programming? Not effective at all Not very effective Somewhat effective Effective Very effective X 8. How effective do you think the simulation would be in teaching you programming without the aid of a human teacher? Not effective at all Not very effective Somewhat effective Effective Very effective X 9. How effective would the addition of a human teacher be when learning through this medium? Not effective at all Not very effective Somewhat effective Effective Very effective X