Page 127 - The Unofficial Guide to Lego Mindstorms Robots
P. 127
116
6
pbFORTH
In this chapter:
• Replacement Firmware
• pbFORTH Overview
• About Forth
• pbFORTH Words
• An Expensive Thermometer
• Minerva Revisited
• Debugging
• Online Resources
In Chapter 4, Not Quite C, I described how NQC allows you to get around many of t he limitations of RCX Code, the
p rogramming environment that comes with RIS. Even NQC, however, has its limitations. Even though you finally have the use
of variables, you're limited to 31 of them. Furthermore, you can't put your own data on the display, which would be very useful
for debugging. In this chapter, I'll talk about pbFORTH (Programmable Brick Forth), a piece of software that gives greater
access to the memory, display, and other resources in the RCX. pbFORTH allows you to program your robots using Forth, an
established language that is suitable for small systems like the RCX.
This chapter will get you up and running with pbFORTH by covering the following topics:
• 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.