2.7.6 Standalone Variables
Standalone Variables
The Commander core has 100 32-bit signed standalone variables available for general purpose use. They can be used to perform basic calculations and support integer operations. The V[0-99] command can be used to access the specified variables. The syntax for all available operations can be found in the table below. Note that these operations can only be performed in standalone programming.
|
Operator |
Description |
Example |
|
+ |
Integer Addition |
V1=V2+V3 |
|
- |
Integer Subtraction |
V1=V2-V3 |
|
* |
Integer Multiplication |
V1=V2*V3 |
|
/ |
Integer Division (round down) |
V1=V2/V3 |
|
% |
Modulus |
V1=V2%5 |
|
>> |
Bit Shift Right |
V1=V2>>2 |
|
<< |
Bit Shift Left |
V1=V2<<2 |
|
& |
Bitwise AND |
V1=V2&7 |
|
| |
Bitwise OR |
V1=V2|8 |
|
~ |
Bitwise NOT |
V1=~V2 |
Operations
All variables can be accessed and written with the ASCII V[0-99] command. Variables V0-V49 will be initialized to zero on power up, and variables V50 through V99 can be stored to flash memory using the STORE command.
< Previous Section | Topic Home | Home | Next Section >