INCORPORATING TANGIBLE COMPUTING DEVICES INTO CS1 *

2 downloads 1235 Views 257KB Size Report
INCORPORATING TANGIBLE COMPUTING DEVICES INTO. CS1 *. Mark Goadrich. Department of Mathematics and Computer Science. Centenary College of ...
INCORPORATING TANGIBLE COMPUTING DEVICES INTO CS1 * Mark Goadrich Department of Mathematics and Computer Science Centenary College of Louisiana Shreveport, LA 71104 318 869-5194 [email protected]

ABSTRACT Evidence shows that introductory computer science instruction can be enhanced with the inclusion of tangible computing devices. This paper demonstrates the integration of three major types of tangibles into the classroom: Arduino microcontrollers, Android phones and Sifteo Cubes. Laboratory assignments and lessons learned for each device are described, followed by an evaluation of their effectiveness in motivating and teaching introductory computing concepts. INTRODUCTION Students today live in a world of where computation is embedded everywhere, from handheld smartphones and tablets, to autonomous vehicles and Google Glass. One direction of current computer science education research is to find ways to leverage these ubiquitous computing devices to better engage students and develop deeper understandings of how they can enhance and transform their environment through computing. In particular, increased motivation of students for studying computing has been shown to be associated with tangible computing devices [1, 2, 7]. However, these studies commonly focus on a single course with a single device.

___________________________________________ *

Copyright © 2014 by the Consortium for Computing Sciences in Colleges. Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, the CCSC copyright notice and the title of the publication and its date appear, and notice is given that copying is by permission of the Consortium for Computing Sciences in Colleges. To copy otherwise, or to republish, requires a fee and/or specific permission.

23

JCSC 29, 5 (May 2014) METHODOLOGY The first course in computer science (CS1) is taught each fall at our institution. Students are first introduced to Scratch, a simple graphical programming language [5]. Scratch allows them to focus on the semantics of programming first without the struggles of correcting syntax errors. Overall, Python is the primary language for the course. Recently, our department increased CS1 from 3 to 4 credit hours; it now meets 3 times a week for 50 minutes, and once a week for a 3-hour lab. We used a portion of this additional time in 2012 and 2013 to introduce students to tangible computing throughout the semester with Arduino microcontrollers, Android phones, and Sifteo Cubes. Each of these three devices were used in the classroom for at least two days, first in a 50-minute time period for introducing the device, and then in a 3-hour afternoon laboratory for extended use. Our lab computers use Windows 7, however all software and hardware are also compatible with Mac OS. In the following sections, we describe the learning outcomes met by using each device in CS1, followed by the software and hardware used in our implementation. We then discuss laboratory assignments used and lessons learned over these two course iterations. Arduino Microcontrollers Arduino microcontrollers are an open-source hardware platform that has become ubiquitous among small-scale electronics projects. Through their use, students can see the connection between software and hardware within software development for embedded systems and robotics controllers.

Student Learning Outcomes ! understand input and output beyond the screen, mouse and keyboard, and ! translate between binary, decimal and hexadecimal number representations.

24

CCSC: Mid-South Conference Software The typical programming language for Arduinos is C++. To avoid swapping languages mid-course, we used ModKit1 , a web-based programming environment similar to Scratch. ModKit requires a locally-run executable to interface with the Arduino, plus a separate installation of the Arduino drivers 2 Hardware We used the Sparkfun Inventors Kit 3 ($99US) as the hardware for our Arduino labs. Each kit includes an Arduino Uno microcontroller, breadboard, multiple LEDs, buttons, resistors, diodes, potentiometers, motors, servos, and various sensors. Labs The Sparkfun Inventors Kit includes an instruction booklet with 12 exercises for students to explore. Each exercise includes wiring diagrams, code, and ways for students to modify the basic code. Whereas the C++ programs in the instruction booklet use a setup() and loop() methodology, ModKit allows for initializing the pin modes graphically, and requires a forever block around any previously looped code. Our first lab exercise instructs the students to create a circuit for a single LED, and write a program that makes it blink. This is the simplest wiring possible on the Arduino and a good “hello world” program that helps ensure the student has installed the proper drivers and located the Arduino COM ports. Figure 1 shows the code for this exercise written in ModKit. We then ask students to modify the program so that the LED blinks like a heartbeat. Students then augment their LED circuit by adding a button. This required students to both read and write to different pins on the board, thus incorporating both input and output into their programs. The final Arduino exercise focused on the use of an RGB LED. A RGB LED allows red, green and blue to be controlled independently through writing output to three output pins. Students first learned about hexadecimal and binary numbers. Then they found color representations on the web, such as “olive” (#808000) and “blue orchid” (#1F45FC), and translated them into decimal representations for use in their programs. Lessons Learned Figure 2 shows a team of students completing the wiring and programming for the LED circuit. We found that students were engaged and excited to be working with computers at a lower level than Python. Based on their prior experience with Scratch, the 1

http://www.modk.it/editor/preview/

2

http://arduino.cc/en/guide/windows#toc4

3

https://www.sparkfun.com/products/retired/11236 25

JCSC 29, 5 (May 2014) students could easily drag and drop blocks to create circuits. While the kit included a wiring diagram for each circuit, these were hard to interpret and implement. We found that Fritzing 4 could be used to dynamically draw and project circuits and increased student understanding. When students explored the other circuits included in the kit, we encountered one limitation related to sound output with the piezo buzzer. ModKit was unable to modulate the frequency fast enough, since the delay block was written with milliseconds, but the differences necessary to produce the standard 12-tone scale are given in microseconds. AppInventor Android OS is now the operating system on the majority of all smartphones purchased in the United States 5. We used AppInventor 6 to develop programs for Android mobile phones; it is another visual language like Scratch and Modkit, and is an open source project maintained and developed primarily at MIT [6]. Student Learning Outcomes ! understand event-driven programming, and ! distinguish between components and functions of objects. Software To use AppInventor, lab computers must have an up-to-date version of Java installed. There are two elements of an AppInventor program, the Component Editor where the GUI and components are created, and the Blocks Editor where the functionality of the components is defined, as seen in Figure 3. Hardware We used the Google Samsung Galaxy Nexus ($349US), as these phones could be purchased in bulk and off contract from Google directly. To work with AppInventor, each phone must be placed into developer mode, and the appropriate drivers installed. Today, it would be possible to consider purchasing refurbished Android devices online for as little as $30US.

4

http://fritzing.org/

5

http://www.businessinsider.com/android-owns-over-80-of-world-market-2013-11

6

26

http://appinventor.mit.edu/

CCSC: Mid-South Conference Labs Students began by implementing the Hello Purr app from the AppInventor tutorials. Using an image component and sound component, students add an event handler that plays a sound when an image is touched. Next, students implemented Paint Pot, adding the ability to draw on a Canvas when touched, and change the color of the pen through using Buttons. The third app, MoleMash, introduces sprites, timers and global variables to recreate the arcade game Whack-A-Mole. Our final AppInventor app displays the image of a die on the screen, and students program this app to simulate rolling this die when the screen is tapped. This app demonstrates the need for programmers to create their own objects.

Lessons Learned AppInventor was introduced as a precursor to Object-Oriented Programming in Python. We were pleased with the student’s subsequent grasp of components and functions. Students were eager to explore more tutorials in AppInventor, however our development phones were not capable of using GPS or text-messaging for some of the more interesting apps. Unfortunately, very large projects can be cumbersome to edit, and the blocks editor occasionally had difficulties connecting to attached phones. One student’s final project mysteriously disappeared when too many blocks were added. At the time of this publication, AppInventor 2 has just been released, which moves the blocks editor into the web-based Component Editor, which could fix some of these issues. Sifteo Cubes Sifteo Cubes, released in September 2011, are a new platform of programmable blocks with applications to music, games, mathematics and language education [4]. Each cube includes an accelerometer, LCD, wireless connection, near field communication and touch-screen interaction, and can be directed to handle shake, tilt, flip, button press and neighbor proximity events. Sifteo Cubes can be thought of as simplified mobile phones, where up to six Cubes can interact when manipulated together.

27

JCSC 29, 5 (May 2014) Student Learning Outcomes ! implement event-driven programming, and ! implement components and functions of objects. Software Sifteo has created the SiftDev 7 environment and SDK for users to create their own programs. The SDK was created for C# programs; however, an undocumented Python implementation is also available. We used the Python version in this course for consistency, and edited our code in IDLE. Each Sifteo program must be created in a separate directory, and requires a manifest.json file. This manifest includes the name of the app, the Python module, the class which subclasses sifteo.base_app.BaseApp, and the cover image. The BaseApp class implements two functions, a setup for initializing the data, and a tick(dt) which is continuously looped. Hardware We used the first edition Sifteo Cube set, which includes 3 cubes, a charging station, and USB connection dongle ($129US) plus 3 additional Cubes ($29US each). No additional drivers are needed to use the Sifteo Cubes.

7

http://support.sifteo.com/entries/21949486-Where-did-the-original]SDK-go28

CCSC: Mid-South Conference Labs Sifteo provided us their unreleased Python SDK demos, and from these we created two labs. The first lab we created introduces the basic concepts of programming with Sifteo Cubes. Students create a list of colors, harkening back to the RGB lessons of the Arduino. The cubes are initialized in the setup function with a random color, then filled and painted. The tick(dt) function accumulates time, and when 1 second has passed, a random cube is selected and repainted a random color. Students then reimplement the MoleMash app from AppInventor, using event handling. In the setup function, four cubes are selected as Mole Holes, one cube as the Hammer, and one cube to is reserved to display the score. A random Mole Hole is selected to hold the Mole, and images are painted on each cube using the rect drawing function. Similar to the first lab, after 1 second has passed, the Mole is moved to a random cube. A neighbor_add event handler is added to the Hammer cube, which scores a point when it is placed next to the moving Mole, and a button_press event handler is added to the hammer to reset the game when pressed. Sounds can also be added to increase the interactivity of the game. Figure 4 shows the Sifteo MoleMash app running in the emulator. Code for these labs, and sample student final projects, can be found at https://dl.dropboxusercontent.com/u/39768761/CSC207-sifteolabs.tar.gz Lessons Learned Introduced after teaching Object-Oriented Programming in Python, Sifteo Cubes are a capstone to the course, and one of the most rewarding labs for our students. Students see a connection between the cubes and the objects they program, as they help physically illustrate one of the most abstract concepts in the course. Debugging Sifteo apps can be tedious, however in Windows, syntax errors and logging messages appear in the terminal window that accompanies SiftDev upon execution. To see these same error messages in Mac OS, SiftDev must be initiated from the command line. Unfortunately, the latest version of Sifteo Cubes can only be programmed in C++, but the first edition Cubes can still be purchased through Amazon.com and Ebay.com. EVALUATION We investigated two ways to evaluate the effectiveness of using tangible devices in CS1 as a motivational tool. First, students were allowed to select a final project topic of their choice. Students could implement an Arduino project, an AppInventor program, an original Sifteo Cube game, a Python program with PyGame graphics, or a Python program with traditional text input/output. Across the 30 students enrolled in 2012 and 2013, 76.7% of students opted for a final project involving tangible computing devices: 40% chose Sifteo Cubes, 30% chose AppInventor, and 6.7% chose Arduino. Second, in 2013 with 10 students, our students were asked in the last week of the course to categorize each lab in the course according to the “usefulness of the labs for understanding computer science”. We used a scale from 1 to 5, where 1 was “worthless” and 5 was “essential.” The Arduino, AppInventor and Sifteo Cube labs scored 4.8, 4.7 29

JCSC 29, 5 (May 2014) and 4.6 respectively, compared to an overall lab average of 4.37. We also include here a sample of student reflections on their classroom experience with tangible devices: ! “Using the Arduino for my final project really made me push myself to new levels of creativity - artistic and intellectual - that I would never have explored otherwise.” ! “I really enjoyed getting to look at what we were doing from a hands-on perspective, especially with the Arduinos where we could follow exactly what was going on. Using the different devices also showed a more practical use for what we were doing, instead of just typing back-and-forth to a computer.” ! “Applying my knowledge from the classroom to the Arduino, Android phone and Sifteo cubes gave me a tangible goal to work towards. Working with these devices bridged the gap between everyday electronic usage and my knowledge of computer science from the classroom, and this greatly sparked my interest.” CONCLUSIONS Our department currently uses Android smartphones in the context of our CS2 Data Structures and Algorithms course with great success [3], and this expands tangible computing opportunities for all of our introductory students. By incorporating tangible devices into a first course on computer science, students in upper-level courses will be prepared for in-depth event-driven programming projects. We plan to improve these three labs based on updated software and hardware in Fall 2014. ACKNOWLEDGEMENTS We are grateful for funding from Louisiana Board of Regents BORSF-004UG-12. REFERENCES [1] Apiola, M., Lattu, M., & Pasanen, T. A. (2010, June). Creativity and intrinsic motivation in computer science education: experimenting with robots. In Proceedings of the fifteenth annual conference on Innovation and technology in computer science education (pp. 199-203). ACM. [2] Buechley, L., Eisenberg, M., Catchen, J., & Crockett, A. (2008, April). The LilyPad Arduino: using computational textiles to investigate engagement, aesthetics, and diversity in computer science education. In Proceedings of the SIGCHI conference on Human factors in computing systems (pp. 423-432). ACM. [3] Goadrich, M., Jadud, M., & Jennings, J. (2011, May). Exploring the Use of Android OS in CS2. In Proc. First International SMArtphones in the Curriculum worKshop (SMACK 2011). [4] Merrill, D., Sun, E., & Kalanithi, J. (2012, May). Sifteo cubes. In CHI’12 Extended Abstracts on Human Factors in Computing Systems (pp. 1015-1018). ACM. 30

CCSC: Mid-South Conference [5] Resnick, M., Maloney, J., Monroy-Hernández, A., Rusk, N., Eastmond, E., Brennan, K., ... & Kafai, Y. (2009). Scratch: programming for all. Communications of the ACM, 52(11), 60-67. [6] Wolber, D., Abelson, H., Spertus, E., & Looney, L. (2011). App Inventor. O’Reilly Media. [7] Wolber, D. (2011, March). App inventor and real-world motivation. In Proceedings of the 42nd ACM technical symposium on Computer science education (pp. 601-606). ACM.

31

Suggest Documents