/* Seg7led.c : To control red led and 7-segment display. Compiler: BC++ 3.1, Turbo C ++ 1.01(3.01) (free from http://community.borland.com/museum) MSC 6.0, MSVC 1.52. Compile mode: large Project: Seg7led.c ..\Lib\(8000E.Lib,7188XAL.Lib,7188XBL.Lib,7188XL.Lib or 7188EL.Lib) Hardware: 7188/8000 [24 May,2005] by Bill [30,Jan,2007] by Liam [Aug,4,2011] by Nicholas */ #include "..\..\lib\7188e.h" void main(void) { int i,data; InitLib(); for(;;) { for(i=0;i<10;i++) { if(i==0 || i==2 || i==4 ||i==6 || i==8) { LedOn(); //Open the LED } else LedOff(); //Close the LED //Show any segment of the 5-Digit 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); //Show the value of 7seg in every 500 ms. } } }