/* Demo4 for five 7-segment LED. with XS_09300.LIB */ #include #include //#include"..\lib\7188e.h" #include"..\lib\8000a.h" #include"..\lib\tcpip32.h" #include"..\lib\MFW.H" void XS_UserInit(int argc,char *argv[]) { void UserLoop(void); char version[20]; InitLib(); XS_GetVersion(version); Print("[X-Server library]: version=%s ",version); XS_GetLibDate(version); Print("date=%s\r\n",version); GetTcpipLibDate(version); Print("Tcpip library version:%X, Library Date is %s\r\n",GetTcpipLibVer(),version); /* for xs_09001.lib ~ xs_09003.lib NEED NOT the next 4 lines. */ XS_AddSystemLoopFun(UserLoop); } /************************************************************************/ void XS_UserEnd(void) { } /************************************************************************/ void UserLoop(void) { int i, j; int data; for(i=1; i<6; i++){ for(j=1; j<6; j++){ if(i!=j){ Show5DigitLed(j,16); //when pos is lighted, others space(off) } } //Show any segment of the 5-Digit Led Show5DigitLed(i, i); /* if you want the 7-segment led shown with the dot, use the following: Show5DigitLedWithDot(4, 0xA); */ Delay(500); //delay 500ms if(Kbhit()){ data=Getch(); if(data=='q' || data=='Q'){ QuitMain=1; } } } } /************************************************************************/ /* XS 0.9.200 or later must add the function main() */ void main(int argc,char *argv[]) { XS_main(argc,argv); /* call the XS library main function. */ }