Online Encyclopedia
LEGO Mindstorms
LEGO Mindstorms is the consumer version of the LEGO Company's product line that includes programmable bricks along with electro-motors, sensors, LEGO bricks, and LEGO Technic pieces (gears, axles, beams, pneumatic components etc.) to build robots and other automated or interactive systems. Although technically a toy, LEGO Mindstorms is also used as an educational tool, as originally intended by LEGO and MIT; it is a good example of an embedded system with computer-controlled electromechanical parts. Almost all kinds of real life embedded systems, from elevator controllers to industrial robots, may be modelled using Mindstorms.
Contents |
The RCX programmable brick
The RCX is the most powerful programmable brick in the Mindstorms line. It contains a Renesas H8/300 microcontroller as its internal CPU. The brick is programmed by downloading a program written in one of several available programming languages from a PC to the brick's CPU via a special IR interface. After program downloading and starting, an RCX-enabled Mindstorms creation may function totally on its own, acting on internal and external stimuli according to the programmed instructions. Also, two or more RCX bricks can communicate with each other through the IR interface, enabling inter-brick cooperation or competition. In addition to the IR port, there are three sensor input ports and three motor output ports (also usable for lamps, etc).
Available programming languages
LEGO-supplied (both of them graphical):
- RCX Code (included in the Mindstorms consumer version sold at toystores)
- ROBOLAB (based on LabVIEW and developed at Tufts University)
Third-party (all of them textual):
- Java under leJOS
- NQC ("Not Quite C")
- C and C++ under BrickOS (formerly LegOS)
- pbFORTH (extensions to the Forth programming language)
- Visual Basic
LEGO distributes the MindStorms SDK featuring examples in Visual Basic and C++.
Simple program example in C
A simple test program written in C for an RCX with a motor connected to output port number one could look like this:
void main () // main program { motor(1,100); // turn motor # 1 on at 100% force sleep(2.0); // let the motor run for 2 seconds ao(); // all off: turn off all equipment }
Thus, motor number one will go at full speed for two seconds before being turned off along with everything else on the RCX.
See also
External links
General information resources:
- Official LEGO Mindstorms Home Page http://mindstorms.lego.com/
- Lego-Robotics Wiki http://www.object-arts.co.uk/wiki/html/Lego-Robotics/FrontPage.htm
- A summary of information and links about many aspects of Mindstorms http://www.crynwr.com/lego-robotics/
Programming languages and operating systems:
- Tufts University's ROBOLAB page http://www.ceeo.tufts.edu/graphics/robolab.html
- leJOS - Java for the RCX Brick http://www.lejos.org/
- The NQC programming language http://bricxcc.sourceforge.net/nqc/
The microcontroller built into the RCX :
- Renesas H8/300 model 3292 block diagram http://www.renesas.com/eng/products/mpumcu/8bit/h8300/3297/3297interb_e.html
References
- Erwin, Benjamin (2001). Creative Projects with LEGO Mindstorms (book and CD-ROM). Addison-Wesley. ISBN 0201708957
- Baum, Dave (2002). Definitive Guide to LEGO MINDSTORMS, 2nd ed. APress. ISBN 1590590635
- Ferrari et.al. (2001). Building Robots With Lego Mindstorms: The Ultimate Tool for Mindstorms Maniacs. Syngress. ISBN 1928994679