6
SV203- Example Interface
OPEN “COM1:9600,N,8,1,CD0,CS0,DS0” FOR OUTPUT AS #1
DO
PRINT:PRINT “*****SV203 Servo Controller *****”
INPUT “Enter Board ID Number:
INPUT “Enter Servo # to control: Servo$
INPUT “Enter Position of Servo: Pos$
PRINT #1, “BD”;ID$;”SV”;Servo$;”M”;Pos$
INPUT “Quit (y/n)”; Q$: IF Q$ = “y” THEN EXIT DO
LOOP
(Listing 1 - Sample interface program using QBASIC)
***** SV203 Servo Controller *****”
Enter Board ID Number:? 1 Board width ID = 1
Enter Servo # to control:? 2 move servo #2 to
Enter Position of Servo:? 200 position 200
Quit (y/n):? n
***** SV203 Servo Controller *****”
Enter Board ID Number:? 0 Any Board regardless of
Enter Servo # to control:? 4 ID, move Servo #4 to
Enter Position of Servo:? 254 position 254
Quit (y/n):? n
***** SV203 Servo Controller *****”
Enter Board ID Number:? 1 Board with ID = 1
Enter Servo # to control:? 2 Turn off Servo #2
Enter Position of Servo:? 0
Quit (y/n):? n
***** SV203 Servo Controller *****”
Enter Board ID Number:? 1 This command is invalid because
Enter Servo # to control:? 9 there is no Servo #9 and also
Enter Position of Servo:? 256 256 is out of the range of the
Quit (y/n):? y servo position.
(Listing 2 - Example screen of when program in Listing 1 is running)
Listing 1 is a simple program written in QBASIC that requests the
user to input a board ID number, a servo number to control, and
the position of the servo.