/* LED.c: Using the DelayMs() function to switch the LED ON and OFF. Compiler: BC++ 3.1, Turbo C++ 1.01 (3.01) MSVC 1.52 Compile mode: Large Project: LED.c ..\..\Lib\upac5000.lib Hordware: uPAC-5000 Description | o o o o | | LED1 Ethernet GSM LED2 | TimerOpen(): Starts the timer. TimerClose(): Stops the timer. If TimerOpen() is called within your program, it must call TimerClose() before exiting. DelayMs(): Suspends execution for interval (milliseconds) [Dec 28, 2011] by Liam */ #include #include "..\..\lib\upac5000.h" void main(void) { int LedMode=0; unsigned long value; int quit=0; InitLib(); /* InitLib() must be called before other functions in the library may be used */ Print("Press 'q' to quit\r\n"); LedOff(); while(!quit) { if(Kbhit()) { switch(Getch()) { case 'q': quit=1; break; default: break; } } DelayMs(500); if(LedMode) { LedMode=0; LedOff(); } else { LedMode=1; LedOn(); } Led2Toggle(); } LedOn(); }