/* 1. Compiler: TC 2.0 2. Mode: Small 3. Project: test7067.prj test7067.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: (1) the led of 7067 will take turn to turn on then turn off . (2) press 'q' or 'Q' to quit this program. Their situation is as fallow: [PC]<---------->[8831]<------------------->[7520]<--------->[7067] RS232 (COM1)(COM4) RS232/RS485 (RS232) (RS485) (RS485) 5. Hordware: 8831 with 7067 It's compiled by Tony -------------------------------------------------------------------------- */ #include #include #include #include #include #include"..\LIB\8000.h" #include"..\LIB\vxcomm.h" /*--------------------------------------------------------------------------*/ #define TimeOut 10000L main() { int i,y; int type; int ver; unsigned char cmd[80], result[80]; type=Is8000(); /*detect the current operation system*/ if(type) { ver=GetLibVersion(); Print("Hello 8831x! (Flash memory is %d K)\n\r",type); Print("Library version is %d.%02d",ver>>8,ver&0xff); } else { Print("Hello PC!, this program is not run under 8831."); return; } Print("\r\nPress 'q' to quit program..."); InstallCom4(115200L,8,0,1); Init5DigitLed(); Show5DigitLed(1,1); Show5DigitLed(2,2); Show5DigitLed(3,3); Show5DigitLed(4,4); Show5DigitLed(5,5); i=y=0; for (;;) { Show5DigitLed(1,i); i=i&0x0f; if (y>=7) y=0; DelayMs(500); if (y==0) strcpy(cmd,"#020001"); else if (y==1) strcpy(cmd,"#020002"); else if (y==2) strcpy(cmd,"#020004"); else if (y==3) strcpy(cmd,"#020008"); else if (y==4) strcpy(cmd,"#020010"); else if (y==5) strcpy(cmd,"#020020"); else if (y==6) strcpy(cmd,"#020040"); SendCmdTo7000(4,cmd,0); y++,i++; if (Kbhit()) { Getch(); return; } } }