/* Seg7led.c : Controls the LED and 5-digit 7-segment LED. Compiler: BC++ 3.1, Turbo C++ 1.01 (3.01) MSVC 1.52 Compile mode: Large Project: Seg7led.c ..\..\Lib\upac5000.lib Hordware: uPAC-5000 [Dec 28, 2011] by Liam */ #include #include "..\..\lib\upac5000.h" void main(void) { int i, data; InitLib(); /* InitLib() must be called before other functions in the library may be used */ for(;;) { for(i=0; i<10; i++) { if(i==0 || i==2 || i==4 ||i==6 || i==8) LedOn(); /* switch the LED ON */ else LedOff(); /* switch the LED OFF */ /* Show 5 digits of the seven-segment LED */ Show5DigitLed(1, i); Show5DigitLed(2, i); Show5DigitLed(3, i); /* Show any segment of the 5-Digit Led and also can show the DOT '.' */ Show5DigitLedWithDot(4, 0xA); //Show the fourth led is 'A'. Show5DigitLedWithDot(5, 0xE); //Show the fifth led is 'E'. if(Kbhit()) { data=Getch(); if(data=='q' || data=='Q') { return; } } Delay(500); } } }