+
Addition
-
Subtraction
*
Multiplication
/
Division
&
Bit-wise AND of two 32-bit variables
|
Bit-wise OR of two 32-bit variables
%
Modulus
=
Assignment
These may be used in Expressions and assignments (see below).
4.5 LET statement (assignment)
A value is assigned to a variable using the LET statement. Example:
LET A = 5
This sets the value of variable A to 5.
4.6 Expressions
Variables, operators and functions may be combined in expressions. Parenthesis may be used.
For example
LET A = 5
LET B = (A + 2) * 3
LET C = AT
This sets the value of variable A to 5, and B to 21. Variable C is set to the GPS altitude in meters.
Many other functions can also be used in expressions, these are described below.
4.7 Functions
4.7.1 IN function
Reads the digital value of one of the 19 GPIO pins; the result is 1 (high) or 0 (low). GPIO pins are
numbered 0 to 18. If you read a pin numbered greater than 18, the pin number is interpreted
modulus 19. For example if you read pin 22, it is the same as reading pin 3.
Syntax:
IN <GPIO pin number expression>
Example:
LET A = IN 6
Reads the digital value from pin 6 and puts it in variable A.
<GPIO pin number expression> is an expression. Therefore the following examples also work:
U4B operating manual Rev 1.00
28