Educating C Language Using LEGO Mindstorms Robotic Invention
Total Page:16
File Type:pdf, Size:1020Kb
Proceedings of the 2006 IEEE International Conference on Robotics and Automation Orlando, Florida - May 2006 Educating C Language Using LEGO Mindstorms Robotic Invention System 2.0 Seung Han Kim and Jae Wook Jeon School of Information and Computer Engineering Sungkyunkwan University 300 Cheoncheon-dong, Jangan-gu, Suwon-city, Korea 440-746 Abstract – A robot highly motivates students and it is one of for most of courses because it motivated students who took the best ways to connect students with the technology. LEGO these courses. This paper will propose on educating ANSI C created a set called Robotic Invention System. This system helps language to students using RIS, which can give students more students to understand the technology of both robot and interest and motivation to learn. programming language. It also improves creativeness by building Using a cross-compiler developed from Cygwin we can and controlling the robot. This paper will propose the idea on educating C language to students using Robotic Invention System control RCX by ANSI C language. BrickOS provides a 2.0. firmware that replaces the default NQC environment of RIS to program with ANSI C language. BrickOS follows the syntax Index Terms – ANSI C Language, LEGO Mindstorms, Robotic rule of ANSI C language. Users can write codes in ANSI C Command Explorer (RCX), Robotics Invention System (RIS) language, compile, and debug them in the way we knew. Unfortunately, not all codes of ANSI C language are compatible with RCX due to its hardware structure. Yet, it can I. INTRODUCTION cover most of contents that freshmen learn in the university LEGO Mindstorms Robotics Invention System 2.0 (RIS) course on C language. LEGO parts are used to construct is a programmable toy which contains blocks, pieces, sensors, autonomous robots. We can use LEGO beams, plates, gears, motors, and a Robotic Command Explorer (RCX). RCX is a motors, and various sensors to connect to RCX for making a programmable block using infrared (IR) transmitter to robot and programming it with ANSI C language codes to communicate with personal computers. RIS provides an iconic control. In this way, we can educate ANSI C language. programming interface application to control the RCX. The We are planning to open a course for students to educate firmware of RIS uses a language, Not Quite C (NQC). This ANSI C language using RIS. The course will be held with programming language is used in the iconic programming lecture on ANSI C language and experiment on RIS robots interface. The software of RIS will automatically convert an with the appropriate codes that fit the content of the lecture. iconic programming interface program into a text program of The degree of difficulty of the lecture will be flexible. NQC and download it to the RCX to run the program. Elementary students will learn the idea of robot and Although the software given to control the RCX is very programming, while university students can learn advanced simple and powerful, it will be better if RCX could be programming in C language. programmed by popular languages like C. Most of educations In section II, it will be explained how LEGO Mindstorms on C language have been performed by personal computers. RIS for education in various fields is used. In section III, They write a program with a text editor and use a compiler to LEGO Mindstorms RIS as a platform to educate ANSI C run the program. Outputs are on the monitor only. It is a language will be explained. In section IV, the method of traditional way to educate C language but it is also limited and controlling RCX using ANSI C language is explained. In fixed. With the RCX, we can download program to it and look section V, a plan for educating students will be explained. In at the program running in a robot, which is more interesting the last section, the conclusion for this paper is described. compared with the monitor based outputs [1]. RIS is widely used in many courses in the world. It is II. USING LEGO MINDSTORMS ROBOTIC INVENTION SYSTEM used to teach physics in some high schools. Many engineering 2.0 FOR EDUCATION IN VARIOUS FIELDS courses in universities use RIS to implement a robot. In some courses, Robolab of Labview is used because it has a simple Many types of robot exist in real world and these robots iconic programming interface. Some courses use RIS and highly motivate students. Robot is one of the best ways to Interactive C language to teach robot programming. connect students with technology. Indeed, robots have Interactive C language is a compile environment developed emerged as useful tools in education because robots provide for robots or embedded systems built with Motorola 6811. It ideas of science and technology [2]. is quite different from American National Standard Institute Penn State Abington College used RIS for their (ANSI) C and its aim is to control the robot instead of introductory programming course for freshman and improving the program skills. The use of RIS was successful sophomore students. Students form teams to design and implement algorithms in the Interactive C language for robots 0-7803-9505-0/06/$20.00 ©2006 IEEE 715 [3]. Although most of students had no programming interface language. Interactive C language was made to experiences, the use of robot was successful. Students could control Motorola 6811 based robots and embedded systems implement programs such as decision and a loop, and test [3]. It is a hybrid of ANSI C language. It only contains them in a real application [4]. necessary codes to control robots. Its main purpose is to Tufts University has a course in mechanical engineering control robot using a computer language. It is quite different that uses RIS. Students form a group of three and they were from ANSI C language. Interactive C language does not have provided with RCX, LEGO bricks, sensors, and Robolab the full contents of ANSI C language. Interactive C can be software. LEGO bricks allow students to create their own assumed as a programming language developed to understand robot and write their own interface and analysis software. and control robots. In this paper, we develop an environment They actively compared their results with others. Also, Tufts to write a program in ANSI C language to control RCX. University worked with pre-college courses in Shady Hill Although RCX do not support all of codes in ANSI C School using Robolab and RCX. Equipments were provided language, it can cover most of the contents that we usually to 8th grade students to teach physics. They used RIS to create learn in the language course. RCX vehicles to learn about velocity and acceleration. Afterwards, they even learned about friction and gears. Using III. LEGO MINDSTORMS ROBOTIC INVENTION SYSTEM 2.0 AS A LEGO bricks have been successful for students in all grades. PLATFORM TO EDUCATE CLANGUAGE Students were highly motivated to learn from the materials. Students got very excited to build, control, and compete with RIS comes with a Microsoft Windows software CD robots they created [5]. which provides an iconic programming interface for Eric Wang and Ryan Wang used RIS and Robolab programming. It is in structure of ‘jigsaw puzzle’ pieces software to meet the science, mathematics, and technology representing commands to control over the available actions levels of local elementary school curricula. Robolab is based by using respective sensors and hardware. Supplied software on Labview and comes with an iconic programming interface is simple enough for children to understand and get attracted which is suitable for elementary students to use [6]. This to it. program does not require any reading or writing skills of text Most important part of the RIS kit is called RCX, the based program codes. This is an important issue in teaching programmable LEGO brick. It is shown in Fig. 1. We have to elementary students. There are two modes, Pilot and Inventor notice that it is a brick. We can build robots based on RCX or mode. Pilot mode uses a fixed program to compile and run. we can design a creative and unique robot depending on our Inventor mode debugs programs under an iconic programming imagination. RCX contains a microprocessor (Hitachi H8300) interface environment. By this experiment, the author inside of a plastic case. There are three output ports and three concludes that elementary students have ability to understand input ports. Three output ports can attach motors and lamps, a program and describe its action [7]. and three input ports allow light, touch, temperature and angle Eli Kolberg and Nahum Orlev examined a course sensors. It has external liquid crystal display (LCD) that can framework for 5th and 6th grade students with understanding of show five characters at one time. Four buttons are on the top technology by using robots. Several students participated in for users to control RCX. IR communication device is building a multi functional autonomous robot. It was held in provided for users to communicate with personal computers weekly session of three hours. They design, construct, and using a universal serial bus (USB) port. assemble a complete robot as the given flow chart. The There are other important parts in the RIS kit. We have authors came with a conclusion that there was great gears, pipes, blocks, and others to use for making a robot. excitement for students who participated in this course and Most people should have seen and have been playing at least that students did their robots were faster than expected [8]. one LEGO model when they were young. It is not a big Texas A&M University-Corpus Christi opened a class problem even though he or she did not have any chance to using RIS for Software Analysis and Design Class.