Along with colleagues Janet Linington and Matt Jadud in the Computer Science Department of the University of Kent, I have been investigating use of LEGO MINDSTORMS kits as a means to promote an interest in Computer Science among school and University students.
Since 2004, the University of Kent has hosted the Kent Regional Final of the FIRST LEGO League as part of our schools liaison activities.
For schools work, I tend to use ROBOLAB, but I also have a particular interest in use of Mindstorms kits with the Java programming language, for which the excellent leJOS environment is the perfect choice. The leJOS project is an open-source project to provide replacement firmware for the RCX processor of the MINDSTORMS kits. Despite the severe memory limitations of the RCX, leJOS provides an almost complete Java bytecode virtual machine.
In support of my particular aims I have developed an alternative to part of the standard leJOS API that I feel better fits the objects-early approach I take to my teaching.
I have reworked the existing leJOS API to fit better
with the objects-early approach I take in my teaching.
My ukcrobots
API
emphasises device construction
and typed sensors slightly more than the original.
In addition, this offers two versions of the sensor classes: one set to which
listeners may be attached (ukcrobots.core
) and a more
lightweight version without listener capability (ukcrobots.simplecore
).
Students programming models with the ukcrobots API | ||||
Below are a couple of examples to illustrate how models may be programmed using this API:
An example using motors and a touch sensor, which uses a listener to detect changes in a sensor's state. A polling version is also available.
An example using a light sensor.
Occasionally I am asked for the source of my API so I am making it available here in gzipped tar format and zip format. I would be pleased to hear from anyone who finds this useful.
At the 34th ACM SIGCSE Technical Symposium on Computer Science Education, 2003, I participated with Pamela Lawhead, Constance Bland, Michaele Duncan, Michael Goldweber, and Madeleine Schep in a special topics session on LEGOS, Java, Programming Assignments and CS 1. There I presented an assignment idea for programming using arrays.
I am in the process of documenting some further
programming exercises based around use of the ukcrobots
API.
The thinking behind the design of my API is described in Teaching Introductory Java through LEGO MINDSTORMS Models, pp 147-151 in Proceedings of the 33rd ACM Technical Symposium on Computer Science Education, Northern Kentucky, February 27 - March 3, 2002.
Abstract: Innovative teachers are continually looking for creative ideas, both to get their ideas across and to hold the interest of their students. One of the latest trends is the use of LEGO MINDSTORMS kits in various computing courses. These kits allow a wide variety of physical models to be built, some of which may be programmed via the RCX processor integrated into them. Using its standard firmware, the RCX device may be programmed through several different specialist languages. However, the additional availability of bytecode-compatible replacement firmware for the RCX makes the use of Java as the programming language for it a particularly attractive approach. In this paper, we explore some of the issues associated with choosing to program MINDSTORMS models using Java within the context of an introductory programming course. In particular, we consider the impact on the material that is taught, and the use of an appropriate API to support an objects-early programming style.
Matt Jadud has undertaken several different strands of work with MINDSTORMS models. You can read about some of this in his papers.
Janet Linington was instrumental in running a project to develop a server program to overcome some of the problems associated with trying to use multiple infra-red towers in a classroom.
The work described here has no official connection with the LEGO company.
LEGO is a registered trademark of the LEGO company.
RCX and MINDSTORMS are trademarks of the LEGO company.
Java is a trademark of Sun Microsystems, Inc.