- Shopping Bag ( 0 items )
Three MINDSTORMS experts have joined with the maintainer of the legOS HOWTO to produce the book that all advanced users of LEGO MINDSTORMS have been waiting for. Each author has written material based on his specialty. Dave Baum shows you how to take Not Quite C (NQC) to its limits. Ralph Hempel explains the ins and outs of pbForth. Michael Gasperi teaches you how to build numerous custom sensors with simple, systematic instructions. Luis Villa show you how (and when) to upgrade MINDSTORMS' built-in operating ...
Three MINDSTORMS experts have joined with the maintainer of the legOS HOWTO to produce the book that all advanced users of LEGO MINDSTORMS have been waiting for. Each author has written material based on his specialty. Dave Baum shows you how to take Not Quite C (NQC) to its limits. Ralph Hempel explains the ins and outs of pbForth. Michael Gasperi teaches you how to build numerous custom sensors with simple, systematic instructions. Luis Villa show you how (and when) to upgrade MINDSTORMS' built-in operating system to take advantage of the extra power of legOS, a complete C environment for the RCX.
Extreme MINDSTORMS: An Advanced Guide to LEGO MINDSTORMS starts with an overview of the RCX firmware and includes a whole chapter on RCX 2.0. Next, the book concentrates on the steps needed to build Seeker, a light-seeking robot, and to program it in NQC. Later chapters extend Seeker's functionality using pbForth and legOS. The book concludes with two chapters on building both custom passive and custom powered sensors. These sensors can take LEGO MINDSTORMS to levels impossible to achieve with just the parts supplied in the box or available through normal channels.
In 1977, LEGO launched the Expert Builder series of sets (later renamed to TECHNIC). Featuring gears, axles, beams, bushings, and even universal joints, these sets could create models that actually worked. Helicopters had adjustable rotors, cars had rack-and-pinion steering, and engines had pistons that moved. These sets brought a new level of engineering sophistication to the LEGO universe. Over the years, new elements continued to be introduced: spring-loaded shock absorbers, pneumatic pistons and valves, and numerous structural and connector pieces. All of these pieces interlocked with one another making LEGO the most versatile construction system in the world. In the fall of 1998, LEGO released the first MINDSTORMS set-the Robotics Invention System (RIS 1.0). To some, this was just another step in a journey that had started nearly 50 years earlier. To others, however, this was a revolution. There were still all of those familiar beams, bricks, and gears. But there was also the RCXLEGO's programmable brick that allowed models not just to move, but to sense and respond to their environment. RIS 1.0 became an instant hit and was one of the hottest selling toys for the 1998 Christmas season. More surprisingly, a significant portion of the"kids" playing with MINDSTORMS were adults.
It seemed to be a long-overdue merging of construction toy and computer. Actually, the idea of merging LEGO with computers wasn't new. For years, researchers at the MIT Media Lab (htt p : / /www. med ia. m it . ed a /) , sponsored in part by LEGO, had been experimenting with programmable toys and the educational opportunities they presented. In the course of this work, several different programmable bricks were developed. LEGO decided to make a commercial product based on the research and the RCX was redesigned from the ground up. Even so, the early programmable bricks from MIT could certainly be considered ancestors of today's MINDSTORMS sets.
The Hackers Step In
LEGO's software was intended to provide an intuitive introduction to programming. However, many of the MINDSTORMS users were experienced programmers who felt that LEGO's simple drag-and-drop environment was too limiting. LEGO was tight-lipped about the details of the RCX, but that didn't prevent me and others from taking matters into our own hands.
Several of us endeavored to unravel the secrets of the RCX and expand its capabilities. Our independent efforts may never have amounted to much if Russell Nelson had not created the LEGO-robotics mailing list. Russell also culled through all of the postings and collected the most interesting tidbits into his LEGO MINDSTORMS Intemals Web site (http: //www. crynwr. com/lego-robotics/). These two resources, the mailing list and the Web site, greatly facilitated our sharing of knowledge and allowed newcomers to also join in the adventure. Eventually, the LEGO-robotics mailing list was merged with the robotics forum at LUGNET (http: //www.lugnet. com/robotics/), run by Todd Lehman. LUGNET is the unofficial repository for all things LEGO and the robotics discussions can be particularly valuable to MINDSTORMS users. Kekoa Proudfoot was the first pioneer into RCX hacking and did a substantial amount of reverse engineering. He revealed many details about the hardware, published a list of bytecodes for the interpreter, and documented the System ROM (see Chapter 2 for more information). His RCX Internals Web site (http:// graphics . stanford. edu/-kekoa/rcx/) contains a wealth of valuable information about the inner workings of the RCX.
At about the same time, I was working towards creating a more "traditional" way of programming the RCX. Starting with old source code to a C preprocessor and a rudimentary understanding of the RCX bytecodes, NQC-the first unofficial programming language for MINDSTORMS-was born. Looking back, it was pretty crude. No local variables. No expressions. No functions. Just a preprocessor, tons of macros, and some code to send the resulting bytecodes over to the RCX. It was, however, a way to write an RCX program with text rather than with graphics; furthermore, it had a very C-like syntax. What started life as an interesting little hack so I could program the RCX from my PowerBook became a popular way for "advanced" users to play with MINDSTORMS. Features were gradually added to NQC to make it more powerful. However, since it relied on LEGO's standard firmware, there were always some fundamental limitations, such as a very small amount of storage for variables and no recursive functions. Other people were striving to break through those limitations by replacing the standard firmware. Starting with Kekoa's documentation for the inner workings of the RCX, Markus L. Noga created legOS (http: //www. noga. de/legOS/), the first replacement firmware for the RCX. This was no small task-writing embedded software is always a difficult business, and writing an operating system without complete documentation of the hardware or System ROM borders on masochism...
|Ch. 1||Extreme MINDSTORMS||3|
|Ch. 2||The RCX||11|
|Ch. 3||Seeker: A Light-Seeking Robot||31|
|Ch. 4||RCX 2.0 Firmware||53|
|Ch. 5||Introduction to pbForth||79|
|Ch. 6||Programming Seeker in pbForth||119|
|Ch. 7||Introduction to LegOS||151|
|Ch. 8||Advanced LegOS||181|
|Ch. 9||Homebrew Passive Sensors||219|
|Ch. 10||Homebrew Powered Sensors||249|
|App. A: Internet Resources||283|
|App. B||NOC API Reference||287|
|App. C||Frequently Used Forth Words||299|
|App. D||LegOS API Reference||317|
|App. E||Installing LegOS||325|