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

120


          This is the same as the previous example, except the 2 is now a 3. The 3 tells pbFORTH to turn the output off. I'll get to the
          details of MOTOR_SET later, after I've introduced you to the Forth language itself.

          Make sure you  separate everything with spaces. pbFORTH reads different words by assuming that they're all separated by
          w hitespace, either spaces or returns. If you miss a space, pbFORTH will get confuse d and complain that it can't find a word
          definition.

          pb FORTH is also case sensitive. While MOTOR_SET is a defined word, Motor_Set is not, nor is motor_set or
          MOTOR_SEt.

          Sending Fil es

          For serious developm ent, you'll want to create your source code in a text file and send the whole file to pbFORTH when you're
          r eady to test. You c an do this with many terminal emulators, although you have to set it up correctly.

          First, the terminal emulator needs to know how long to wait after sending each character. In HyperTerminal (in Windows 95,
          98, or NT), this setting is available in the File > Properties menu option. In the window that appears, choose the Settings tab
          and press  the  ASCII Setup  button.  You should set the  Line delay  to 100 milliseconds and the  Character delay  to 20
          milliseconds, as shown  in Figure 6-2.



























                                                        Figure 6-2.
                                            Setting character delays for sending files

          To upload a fil e to pbFORTH, choose Transfer → Send Text File from the menu.
   126   127   128   129   130   131   132   133   134   135   136