/* ========================================================================== */ /* */ /* 7000.c */ /* (c) 2006 Eva Li */ /* EX for I-7560D to use function: */ /* SendCmdTo7000 */ /* ReceiveResponseFrom7000 */ /* ascii_to_hex */ /* ========================================================================== */ #include #include void main() { int port=2,quit=0,x; char k; InitLib(); InitLCD(); InstallCom(port,115200L,8,0,1); ClearCom(port); SendCmdTo7000(port, "@0100", 0); /*to Do, all off*/ if(ReceiveResponseFrom7000(port,"@0100",1500,0)) Print("I-7065D is not available\r\n"); while(!quit) /*control Do*/ { Print("\n\r enter 1~5 to set [Do] on...'9' to quit\n\r"); k=Getch(); x=ascii_to_hex(k); /*change ASCII code to hex*/ ClearCom(port); switch(x) { case 1: SendCmdTo7000(port, "@0101", 0); Print("[%x]=ON",x);break; case 2: SendCmdTo7000(port, "@0102", 0); Print("[%x]=ON",x);break; case 3: SendCmdTo7000(port, "@0104", 0); Print("[%x]=ON",x);break; case 4: SendCmdTo7000(port, "@0108", 0); Print("[%x]=ON",x);break; case 5: SendCmdTo7000(port, "@0110", 0); Print("[%x]=ON",x);break; case 9: quit=1; Print("*quit*");break; } }//while loop CloseLCD(); }