Installation guide

Programming Commands 83
CHR$ String Manipulation
ACTION: Returns a one character string whose ASCII code is the argument.
PROGRAM SYNTAX: CHR$(code)
REMARK: CHR$ is commonly used to send a special character to the serial port.
EXAMPLE: PRINT#1,”Input Accel”,CHR$(27)
Transmits “Input Accel <ESC>“ to the host serial port.
COMMON Miscellaneous Command
ACTION: Allows variables to be shared by other tasks.
PROGRAM SYNTAX: COMMON variable[,variable][,variable]
REMARK: If a variable defined in one task is to be used in another task, the vari-
able name must be declared by the COMMON statements in both
tasks, COMMON statements should be placed at the start of the task.
EXAMPLE: --------------TASK 1---------------
COMMON X ‘shared variable
---------------TASK2----------------
COMMON X ‘shared variable
COS Mathematics Function
ACTION: Returns the cosine of the angle x, where x is in radians.
PROGRAM SYNTAX: COS(x) - used in an expression
REMARK: To convert values from degrees to radians, multiply the angle (in de-
grees) by π/180 (or 0.017453).
To convert a radian value to degrees, multiply it by 180/π (or
57.295779).
EXAMPLE: PI=3.141593
A=COS(PI/3) ‘ sets A=0.5, which is the cosine of 60°