/* DEMO95.C Demonstration for use Timer functions. Use UserTimer function to Flash LED every 0.5 sec */ #include #include"..\lib\7188.h" /* After call InstallUserTimer(MyTimerFun); MyTimerFun will be called every 1ms. */ void MyTimerFun(void) { static int count=0; static int LedMode=0; count++; if(count>=500){ count=0; if(LedMode){ LedOff(); LedMode=0; } else { LedOn(); LedMode=1; } } } void main(void) { int quit=0; if(!Is7188()){ printf("\ndemo90.exe must run on I-7188"); return; } LedOff(); TimerOpen(); InstallUserTimer(MyTimerFun); while(!quit){ if(kbhit4() && getch4()=='q') quit=1; } TimerClose(); LedOn(); }