Page 129 - Robots Androids and Animatrons : 12 Incredible Projects You Can Build
P. 129

Compile
                                The  PICBASIC  compiler  must  be  run  from  DOS  or  from  a  DOS
                                prompt window within Windows. I ran the PICBASIC compiler from
                                the APPLICS directory. Make sure the wink.bas file is also in the
                                PICBASIC  directory.  The  PICBASIC  compiler  is  compatible  with
                                dozens of different PIC microcontrollers. In order to compile a pro-
                                gram for a specific microcontroller, the PICBASIC compiler needs to
                                know which microcontroller we are using. To compile a program for
                                the 16F84, we add -p16F84 to our pbc command.
                                So the complete command is pbc -p16f84 wink.bas. At the DOS
                                prompt, type in the command and hit the Enter key (see Fig. 6.7).
                                C:/APPLICS>pbc -p16F84 wink.bas
                                The compiler displays an initialization copyright message and begins
                                processing  the  BASIC  source  code  (see  Fig.  6.8).  If  the  BASIC
                                source code is without errors, it will create two additional files. If the
                                compiler finds any errors, it displays a list of errors with their line
                                numbers. Match the line numbers in the error message to the
                                line numbers in the .bas text file to locate where the errors occurred.
                                The errors need to be corrected before the compiler can compile the
                                source code correctly.
           108                  You can look at the files by using the dir directory command.
                                Type dir at the command prompt and hit Enter (see Fig. 6.9).
                                C:\APPLICS> dir





























                                  6.7 Entering compile command
                                                       Team LRN
            Chapter six
   124   125   126   127   128   129   130   131   132   133   134