User manual

ASURO - 66
-
C for ASURO
9.2.1. void Init(void)
This function will reset the microprocessor to its initial state and must always be executed at the
beginning of a program. If the function is missing, the processor does not even know, what to do
with its terminals. A simple ASURO program should at least look like:
#include “asuro.h”
int main(void) { // here we declare some variables
Init(); // here we insert our own function blocks
while(1); // eternal loop
return 0; // will never be executed
}
Why did we insert the eternal loop at the end of the main () -function? Normally the main () -
function will be closed by return 0; marking the end of the program. In ASURO however some
parts of old programs  ashed earlier, may still remain in the memory and be executed, resulting in
strange effects. To avoid abnormal execution of old program fractions we “catch” the program after
execution in an eternal loop. This way we can be sure the program ends in a de ned state.
9.2.2. void StatusLED (unsigned char color)
The Status-LED (D12) will be switched OFF or ON. Valid parameter values are
OFF, GREEN, RED or YELLOW
Example:
The Status-LED will be switched ON in red by:
StatusLED (RED);
OK, OK, we will demonstrate a complete example program:
#include „asuro.h“
int main(void) {
Init();
StatusLED (YELLOW);
while(1); // eternal loop
return 0;
}