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

55


          Now compile the source code using the nqc command:

            C:\>nqc Hank.nqc

            C:\>

          If you made a mistake typing in the program, nqc gives you a list of errors. Otherwise, you're ready to download the program
          with the -d option:

            c:\>nq  c -d Hank.nqc
            Downloading Program:…..complete

            c:\>

          (If you need to specify a serial port different from the default, use the -S option.)

          Go ahead and run the program. When you're done playing, come back and get some background on the software that runs the
          RCX.

          RCX Software Architecture

          Writing a program for the RCX involves a handful of software layers, both on the development PC and on the RCX itself.
          Figure 4-1 shows an overview of the important pieces.



























                                                        Figure 4-1.
                                                  RCX software architecture


          ROM

          The RCX is a small computer that is based on a Hitachi H8/3292 microcontroller. The RCX contains two kinds of memory:
          Read Only Memory (ROM) and Random
   61   62   63   64   65   66   67   68   69   70   71