Page 128 - The Unofficial Guide to Lego Mindstorms Robots
P. 128

117


          Table 6-1. pbFORTH and legOS Compared, Briefy

                                   pbFORTH          legOS

          P rogramming language      Forth          C  or  C++

          In teractive?            Yes              No

          Development OS            Any             Unix, Linux, or  similar

          P rogramming tool            Terminal emulator   C compiler, either gcc or egcs

          As a develo pment 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
          p bFORTH, t his 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 openended; all you need is a t erminal emulator or some other simple software that talks to the RCX's IR port. You can
          in teract with pbFO RTH from a Windows terminal emulator, a Java application running on Linux, or even a custom-developed
          ap plication on a Pal mPilot.

          development cycle
          A development cycle is the sequence of steps you need to follow to write and run a program. With pbFO RTH, this sequence of
          ste ps is farily short. Basically, you upload o r type your program into pbFORTH via a terminal emulator running on your PC.
          The program is immediatel y available to run. With legOS, you need to compile the program on your PC and download the
          whol e 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 so ftware, 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.

          p bFORTH Overview

          Although I'm describing pbFORTH as a way around the limitations of NQ C, it's not NQC that limits your robot programs;
          N QC 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
          fir mware itself. Figure 6-1 shows a block  diagram, similar to Figure 4-1, that shows how pbFORTH replaces the RCX's
          firm ware.
   123   124   125   126   127   128   129   130   131   132   133