Home
Up

RobotARM Commands


To assist teachers in evaluating RobotARM this is a detailed reference of the commands used to control the RobotARM, adapted from the CamSoft website.

Where a group of commands are shown in a sentence i.e. "TURN ELBOW CW 2" they must be entered in this way. RobotARM will not accept command line variations which are not listed here.


Basic command functions

RobotARM recognises the following basic functions to control the RobotARM. Note that the maximum value of n is 9. It is important to leave a space between each part of the command.


CLOSE FINGERS (n)
Closes the fingers.
Example: CLOSE FINGERS 5


OPEN FINGERS (n)
Opens the fingers
Example: OPEN FINGERS 4


TURN ELBOW ACW (n)
Turns the elbow anti clockwise.
Example: TURN ELBOW ACW 6


TURN ELBOW CW (n)
Turns the elbow clockwise.
Example: TURN ELBOW CW 3


TURN SHOULDER ACW (n)
Rotates the shoulder anti clockwise.
Example: TURN SHOULDER ACW 7


TURN SHOULDER CW (n)
Rotates the shoulder clockwise.
Example: TURN SHOULDER CW 4


TURN WRIST ACW (n)
Turns the wrist anti clockwise.
Example: TURN WRIST ACW 2


TURN WRIST CW (n)
Rotates the wrist clockwise.
Example: TURN WRIST CW 4


Decision making commands


END IF
The END IF command line tells R-ARM that the IF command line has finished.
Example: END IF


IF BEEPER IN CLAW = TRUE THEN
If a beeper is held in the claw then the command lines will be carried out until R-ARM reaches END IF.
Example:
IF BEEPER IN CLAW = TRUE THEN
TURN SHOULDER ACW 3
END IF


IF BEEPER IN CLAW = FALSE THEN
If a beeper is not held in the claw then the command lines will be carried out until R-ARM reaches END IF.
Example:
IF BEEPER IN CLAW = FALSE THEN
TURN SHOULDER CW 3
END IF


IF ROBOT WORKS = FALSE THEN
If the RobotARM becomes un-useable i.e. it will not move or respond to commands because it has collided with the floor. Command lines will be carried out until R-ARM reaches END IF, although further primitive commands will not function!
Example:
IF ROBOT WORKS = FALSE THEN
HOME
END IF


IF ROBOT WORKS = TRUE THEN
If the RobotARM is useable the command lines will be carried out until R-ARM reaches END IF.


Program Loops


END REPEAT
Tells R-ARM that this is the end of a REPEAT (n) or REPEAT FOREVER loop.
Example: END REPEAT


END WHILE
This is used in a while loop. When R-ARM encounters END WHILE either it returns to the WHILE loop to test the condition again or carries out the commands below END WHILE.
Example: END WHILE


REPEAT (n)
Repeats the commands on the lines below until it reaches the END REPEAT command, when it begins to execute the commands again. It repeats the command line sequence by the number after REPEAT. REPEAT 4 command line will repeat the commands below 4 times.
Example:
REPEAT 4
WAIT 1
TURN ELBOW CW 2
WAIT 1
TURN SHOULDER CW 2
END REPEAT
END

When you use the REPEAT command you must tell R-ARM by using the END REPEAT command that you have finished the repeat sequence.


REPEAT FOREVER
Repeats the commands on the lines below until it reaches END REPEAT when it begins to execute the commands again. It repeats the commands forever!
Example: REPEAT FOREVER


SUB END REPEAT
Tells R-ARM that this is the end of a SUB REPEAT (n) or SUB REPEAT FOREVER loop.
Example: SUB END REPEAT


SUB REPEAT (n)
To repeat a further series of commands within a REPEAT (n) loop, use SUB REPEAT (n) and the SUB END REPEAT command lines.
Example:
REPEAT 4
TURN SHOULDER CW 1
SUB REPEAT 3
TURN WRIST CW 1
SUB END REPEAT
END REPEAT
END
If you go to a procedure from within a REPEAT (n) loop and require
a repeat loop, use the SUB REPEAT (n) and the SUB END REPEAT
command lines.

Example:
REPEAT 2
GO down
END REPEAT
PROC down
SUB REPEAT 3
TURN SHOULDER CW 1
TURN ELBOW CW 1
SUB END REPEAT
END PROC
END


SUB REPEAT FOREVER
Repeats the commands on the lines below until it reaches SUB END REPEAT when it begins to execute the commands again. This command line is used within a standard REPEAT (n) or REPEAT FOREVER loop.
Example: SUB REPEAT FOREVER


WHILE BEEPER IN CLAW = TRUE DO
While a beeper is held in the RobotARMs claw the command lines will be carried out until R-ARM reaches END WHILE.
Example:
WHILE BEEPER IN CLAW = TRUE DO
TURN SHOULDER ACW 3
END WHILE


WHILE BEEPER IN CLAW = FALSE DO
While a beeper is not held in the RobotARMsÕ claw the command lines will be carried out until R-ARM reaches END WHILE.
Example:
WHILE BEEPER IN CLAW = FALSE DO
TURN SHOULDER CW 3
END WHILE


WHILE ROBOT WORKS = TRUE DO
While the RobotARM is useable the command lines will be carried out until R-ARM reaches END WHILE.
Example:
WHILE ROBOT WORKS = TRUE DO
TURN SHOULDER CW 2
END WHILE


WHILE ROBOT WORKS = FALSE DO
If the RobotARM becomes un-useable i.e. it will not move or respond to commands. Command lines will be carried out until R-ARM reaches END WHILE, although further primitive commands will not function!

Example:
WHILE ROBOT WORKS = FALSE DO
STOP
END WHILE


Other commands


END
The END command tells R-ARM that this is the end of your program. This command must be on the last line of your program
Example: END




END PROC
This is used at the end of a procedure.
Example: END PROC

GO (procedure name)
To call a procedure use the GO command followed by the name of the
procedure you wish to call. When the procedure has been carried out
R-ARM resumes the program at the line below the GO (name) command line.
Example: GO four


HOME
Returns the RobotARM to its default start position.


PROC (name)
A procedure is a list of commands which is called by the main program. The purpose is to group together a series of commands, which you would have to keep typing in over and over again. Each procedure must have a name which does not conflict with a command word. The name of the procedure is entered after the PROC command word.
Examples:
PROC move
PROC change
This procedure moves the RobotARM down the screen.

PROC move
TURN SHOULDER CW 9
CLOSE FINGERS 2
END PROC

The END PROC command tells R-ARM that this is the end of the procedure.
The procedure(s) must be below the main program but before the END command or they will not work properly. Note: You may call a second procedure from one procedure, but R-ARM does not support calling a further procedure from the second procedure.


REM (text)
The REM command is useful for putting in remarks about the program.
Type in the REM command followed by any sentence or remarks about the program you are writing.
Example: REM this is the start of the procedure.


RUB OUT
This command rubs out all the messages in the write window.
Example: RUB OUT


SOUND
Produces a beep through the computers internal speaker.


STOP
Exits the program you are running.
Example: STOP


WAIT (n)
The WAIT command will not execute any further commands until the time, given in seconds, has elapsed. The number after WAIT is how long you want the program to wait for. WAIT 10 will hold for 10 seconds. WAIT 3 will hold for 3 seconds.
Example: WAIT 7 holds for 7 seconds.
The maximum number WAIT will hold for is 60.


WRITE (message)
Type in after WRITE a message. This will be displayed in the write
window. You can change the font by selecting the font menu in the
WRITE window. This opens the font window which gives details of the
available fonts on your computer. Select a font and click on the OK
button when you have finished.
Example: WRITE Hello