/* 1. Compiler: TC 2.0 2. Mode: Large 3. Project: test7050.prj test7050.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: (1) The led of 7050D will take turn to turn on then turn off . (2) To press 'q' or 'Q' to quit this program. **Their situation is as fallow: [PC]<---------->[8831]<------------------->[7050] RS232 (COM1) (COM4) RS232/RS485 (RS485) 5. Hordware: 8831 with 7050 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; unsigned char cmd[80], result[80]; int type; int ver; 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; } InstallCom4(115200L,8,0,1); Init5DigitLed(); Show5DigitLed(1,1); Show5DigitLed(2,2); Show5DigitLed(3,3); Show5DigitLed(4,4); Show5DigitLed(5,5); i=y=0; Print("\r\nPress 'q' to quit program..."); for (;;) { Show5DigitLed(1,i++); i=i&0x17; y=y&0x03; DelayMs(1000); 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; } } }