ASURO - 56 -
9. C for ASURO
This chapter is devoted to the programming language C, but explanation will be limited to the
elements which are needed to control the ASURO system. Obviously the explanation is not a
complete C-manual, for which other literature may be found on the market
1
.
C has been chosen for its widespread standard and because a C-Compiler is available for almost
every processor. For ASURO we selected the Gnu-C-Compiler, a freeware program, which
generates a well optimized code for ASUROs ATmega8 processor.
Whoever is familiar with C will not read anything new in this part of the manual and may proceed
reading chapter
9.2.
We will describe selected elements, absolutely necessary for the ASURO
control.
Don’t worry: If you take care to use brackets and semicolons, the language C is not too diffi cult at
all. And of course the ASURO is not a toy!
9.1. Basics in C-Programming
9.1.1. Introduction
Basically the processor executes commands in a C-program step by step from the beginning to
the end of the program
2
. Parallel processing cannot be provided in ASUROs standard processor,
so we will have to think in sequential working commands.
Empty spaces at the beginning of lines in examples, are simply structural reading aids and may be
left out. Inset spaces however provide excellent programming structure and are extremely helpful
keeping an overview in extended programs.
In C each command has to be completed with a semicolon “;”, enabling the compiler to assign all
elements to the correct command. If commands are to be joined in functions, loops or conditional
statements, this set of commands will be grouped by placing it inside a pair of special brackets
(“{”, “}”).
Example:
#include “asuro.h”
int main(void) {
/* All elements between these brackets belong to one set of commands */
}
1For Example: Brian W. Kerninghan, Dennis M. Ritchie: “Programming in C”,
2Methods to deviate from sequential control in programs ar being named „fl ow control“ and will be
described in a later chapter.
Содержание DLR ASURO
Страница 36: ...ASURO 36 Software Now this screen will show up Click I Agree This screen appears Click Next...
Страница 37: ...ASURO 37 Software The next screen appears Click Install and the next screen appears Wait...
Страница 40: ...ASURO 40 Software Select on the rigth side C C C C is selected Click Add to insert a new tool...
Страница 45: ...ASURO 45 Software Just for try we will open the file C ASURO_src FirstTry test c Click Open...
Страница 74: ...ASURO 74 B ASURO DIAGRAM Appendices...
Страница 75: ...ASURO 75 Appendices C RS 232 Transceiver...
Страница 76: ...ASURO 76 D USB Transceiver Appendices...
Страница 77: ...ASURO 77 E Block diagram ASURO F Block diagram PIC processor Appendices...
Страница 78: ...ASURO 78 G Contents ASURO KIT Appendices...