
• An overview of the pbFORTH software architecture
• Obtaining and installing pbFORTH
• A brief description of Forth
• Listings of RCX-specific words defined in pbFORTH
• Example programs
Replacement Firmware
Later, in Chapter 10,
legOS,
I'll talk about another popular programming environment. legOS and pbFORTH are both
replacement firmware,
which means they actually replace the software on the
RCX. This is the next level of power and complexity beyond NQC. If you're considering this move, which should you choose? It all depends, of course, on what you're trying to do and what
programming you've already done. Table 6-1 compares pbFORTH and legOS in several important areas.
Page 117
Table 6-1. pbFORTH and legOS Compared, Briefy
pbFORTH
legOS
Programming language
Forth
C or C++
Interactive?
Yes
No
Development OS
Any
Unix, Linux, or similar
Programming tool
Terminal emulator
C compiler, either
gcc
or
egcs
As a development environment, pbFORTH excels in two areas:
startup cost
There's a certain amount of pain, the
startup cost,
associated with learning and using a new development environment. For pbFORTH, this startup cost is low. The software tools you'll need on the
PC side are simple and commonly available. Compare this with legOS, which requires some heavy-duty development tools that can be tricky to install and configure. pbFORTH is very open-
ended; all you need is a terminal emulator or some other simple software that talks to the RCX's IR port. You can interact with pbFORTH from a Windows terminal emulator, a Java application
running on Linux, or even a custom-developed application on a PalmPilot.
development cycle
A
development cycle
is the sequence of steps you need to follow to write and run a program. With pbFORTH, this sequence of steps is farily short. Basically, you upload or type your program into
pbFORTH via a terminal emulator running on your PC. The program is immediately available to run. With legOS, you need to compile the program on your PC and download the whole thing to
the RCX, which takes a couple of minutes.
However, before you get all fired up about pbFORTH, remember some caution is in order. pbFORTH itself works well, especially considering it's relatively new software, but there are only a few
good tools for working with it. As of this writing, you will have to put up with ugly-looking terminal sessions to program your RCX with pbFORTH.
pbFORTH Overview
Although I'm describing pbFORTH as a way around the limitations of NQC, it's not NQC that limits your robot programs; NQC just reflects the limitations of the RCX firmware. Remember, NQC
is a replacement for software on the PC only. It generates bytecodes, just like RCX Code, that are downloaded and interpreted on the RCX itself. NQC's limitations are the result of the limitations
of the bytecode interpreter on the RCX. To break through this barrier, you have to replace the RCX firmware itself. Figure 6-1 shows a block diagram, similar to Figure 4-1, that shows how
pbFORTH replaces the RCX's firmware.
Summary of Contents for MINDSTORMS Robots
Page 22: ...Page 18 The back tread wheels are anchored to the shafts with the 16t gears ...
Page 23: ...Page 19 Page 20 Next start building support for the drive motors ...
Page 26: ...Page 23 The touch sensors are attached only by the shaft that runs through them ...
Page 41: ...Page 41 ...
Page 43: ...Next build the support for the light sensor ...
Page 80: ...Page 85 Make sure the bump on the long pin is up against the 4u beam ...
Page 82: ......
Page 84: ...Page 89 ...
Page 85: ...Step 14 is similar to Step 11 take a deep breath and go slowly ...
Page 87: ...Page 91 ...
Page 88: ...Page 92 Make sure that the two sides are at the same angle They should mirror each other ...
Page 89: ...Page 93 Page 94 ...
Page 90: ...Structural Support Page 95 ...
Page 91: ...Idler Wheel Page 96 ...
Page 92: ...Page 97 Drive Motor ...
Page 93: ...While you re putting the motor in hold on to the worm gear so it doesn t slip off Page 98 ...
Page 94: ...Grabber Arm Motor ...
Page 95: ...Page 99 ...
Page 96: ...Page 100 RCX Attach the RCX on both sides as shown Page 101 ...
Page 158: ......
Page 159: ...Page 175 The 16t gears are nestled inside the tread wheels ...
Page 160: ...Page 176 ...
Page 161: ...Page 177 Attach the motors to output A and output C as shown Page 178 ...