/* 1. Compiler: TC 2.0 2. Mode: Small 3. Project: test7060.prj test7060.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: (1) the led of 7060D 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]<--------->[7060] RS232 (COM1)(COM4) RS232/RS485 (RS232) (RS485) (RS485) 5. Hordware: 8831 with 7060 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 8831! (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&0x17; y=y&0x03; DelayMs(500); if (y==1) strcpy(cmd,"#010001"); else if (y==2) strcpy(cmd,"#010002"); else if (y==3) strcpy(cmd,"#010004"); else if (y==0) strcpy(cmd,"#010008"); SendCmdTo7000(4,cmd,0); y++; if (Kbhit()) { Getch(); return; } } }