/* 1. Compiler: TC 2.0 2. Mode: Lgrge 3. Project: Led.prj Led.c ..\lib\8000l.lib ..\lib\tcpipl.lib 4. Explain: This program is used to power on and power off sustained. * Press 'q' or to quit this program. 5. Hordware: 8831 It's compiled by Tony ----------------------------------------------------------------------------- */ #include #include #include #include #include #include"..\LIB\8000.h" #include"..\LIB\vxcomm.h" /*-----------------------------------------------------------------------------*/ void main(void) { int data; int type; int ver; type=Is8000(); /*detect te 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("Press 'q' to quit.\n\r"); for(;;){ LedRunOn(); DelayMs(100); LedRunOff(); DelayMs(100); LedBattOn(); DelayMs(100); LedBattOff(); DelayMs(100); LedCommOn(); DelayMs(100); LedCommOff(); DelayMs(100); if(Kbhit()){ data=Getch(); if(data=='q' || data=='Q') break; else { Putch(data); if(data=='\r') Putch('\n'); } } } }