![Arexx DLR ASURO Assembly And Operation Manual Download Page 59](http://html.mh-extra.com/html/arexx/dlr-asuro/dlr-asuro_assembly-and-operation-manual_2967241059.webp)
ASURO - 59 -
C for ASURO
9.1.3. Compiler directives
You may have wondered about the fi rst program line #include “asuro.h”. This #include-directive
defi nes an inclusion of an external source code into your program and orders the compiler to
include the textfi le in the compiler sequence. Our include-fi le contains some functions, which will
be needed for robot operations.
Another important directive (amongst others, which are lying beyond the scope of our introduction
to C) is the so called text replacement. This directive will be defi ned by a pattern:
#defi ne NAME replacement_text
and wil be used to defi ne constants in our programs.
Wherever the symbol NAME is found in the source text, it will be replaced automatically by
replacement_text. For the NAME following #defi ne the same naming conventions as for variables
have to be applied. C-programmers are used to writing the symbols (eg. NAME) at the #defi ne in
capital letters.
Example:
#include “asuro.h”
#defi ne STARTINGVALUE 33
int main(void) {
int i;
i= STARTINGVALUE; // the value for i is now 33
return 0;
}
Remark: Compiler directives are not closed by a semicolon!
9.1.4. Conditions
Sometimes we would like to execute commands under certain conditions. These conditional
sequences are called control structures. The simplest of these control structures is an “if-else”
sequence.
In “C” the correct syntax will be as follows:
if (Condition)
Command_block_1
else
Command_block_2
The program will check the value of the condition between the brackets. If the condition is true
(which implies any value except zero), the program will execute Command_block_1 and otherwise
the optional Command_block_2.
Summary of Contents for DLR ASURO
Page 36: ...ASURO 36 Software Now this screen will show up Click I Agree This screen appears Click Next...
Page 37: ...ASURO 37 Software The next screen appears Click Install and the next screen appears Wait...
Page 40: ...ASURO 40 Software Select on the rigth side C C C C is selected Click Add to insert a new tool...
Page 45: ...ASURO 45 Software Just for try we will open the file C ASURO_src FirstTry test c Click Open...
Page 74: ...ASURO 74 B ASURO DIAGRAM Appendices...
Page 75: ...ASURO 75 Appendices C RS 232 Transceiver...
Page 76: ...ASURO 76 D USB Transceiver Appendices...
Page 77: ...ASURO 77 E Block diagram ASURO F Block diagram PIC processor Appendices...