![Arexx DLR ASURO Скачать руководство пользователя страница 66](http://html.mh-extra.com/html/arexx/dlr-asuro/dlr-asuro_assembly-and-operation-manual_2967241066.webp)
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 fl 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 defi 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;
}
Содержание 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...