(-15).
Example: Please refer to “CountDownTimerStart ()” function for
more detailed information.
InstallUserTimer()
Function: Installs a custom timer function, which will be called at
intervals of 1ms.
Syntax:
void InstallUserTimer(void (*fun)(void));
Header: #include
”7188xc.h”
Description: fun: A pointer to the custom function. The function
cannot use an input argument and cannot return a value.
Example:
#include “7188xc.h”
int Data[3]={0,0,0};
void MyTimerFun(void) /*custom timer function*/
{
static int count[3]={0,0,0};
int i;
for(i=0;i<3;i++){
Print("count[%d]=%d\r",i,count[i]);
count[i]++;
}
if(count[0]>=200){ /*LCD lamp1 blinks each 200 units*/
count[0]=0;
if (Data[0]==0) Data[0]=1;
else Data[0]=0;
lamp(1,1,Data[0]);
}
if(count[1]>=500){ /*LCD lamp2 blinks each 500 units*/
count[1]=0;
if (Data[1]==0) Data[1]=1;
else Data[1]=0;
lamp(2,1,Data[1]);
}
if(count[2]>=1000){ /*LCD lamp3 blinks each 1000 units*/
count[2]=0;
if (Data[2]==0) Data[2]=1;
else Data[2]=0;
lamp(3,1,Data[2]);
}
}
I-7188XC Series User’s Manual(Ver.1.0, Apr/2007,7MH-21-10) ---
124
Содержание I-7188XC Series
Страница 87: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 87...
Страница 136: ...I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 136...
Страница 142: ...Step 8 Make the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 142...
Страница 149: ...Step 8 Rebuild the project I 7188XC Series User s Manual Ver 1 0 Apr 2007 7MH 21 10 149...