Page 59 - Amphibionics : Build Your Own Biologically Inspired Robot
P. 59
Amphibionics 03 3/24/03 8:11 AM Page 38
Amphibionics
PROGRAM 3.1
pause 6
frog-test.bas program
next timer2
listing (continued) pulsout servo_l,servo_pos_l
return
right_servo
for timer3 = 1 to 10
pulsout servo_r,servo_pos_r
pause 6
next timer3
return
end
Once you are satisfied that the program you have written will work
flawlessly, you can execute the PicBasic Pro Compiler by entering
PBP, followed by the name of your text file at a DOS prompt. For
example, if the text file you created is named frog-test.bas, at the
DOS command prompt, enter:
PBP frog-test.bas
The compiler will display an initialization (copyright) message and
process your file. If it likes your file, it will create an assembler
source code file (in this case, named frog-test.asm) and automat-
ically invoke its assembler to complete the task. If all goes well, the
final PICmicro code file will be created (in this case, frog-text.hex).
If you have made the compiler unhappy, it will issue a string of
errors that will need to be corrected in your BASIC source file
before you try compilation again.
To help ensure that your original file is flawless, it is best to start
by writing and testing a short piece of your program, rather than
writing an entire 100,000-line monolith all at once and then trying
to debug it from end to end.
If you don’t tell it otherwise, the PicBasic Pro Compiler defaults to
creating code for the PIC 16F84. To compile code for PICmicros
38