C Codes
Beginners
C on Unix
Code Snippets
Data Structures
File Operations
Games Graphics
Gnu-Linux
Hardware
Mathematics
Miscellaneous
Small Programs
Sorting
C > Hardware Interaction Through C sample source codes
Sequential Display of Lights
Sequential Display of Lights #include<iostream.h> #include<conio.h> #include<dos.h> main() { clrscr(); int port=0x378; int i,n,j,t; textcolor(14); cout<<" "; cprintf(" A PROGRAM FOR MONETRING SYSTEM "); cout<<" "; cprintf(" Enter the number of cycles -> "); cin>>n; cprintf(" Enter the time delay between each display -> "); cin>>t; j=t*100; for(i=1;i<=n;i++) { outportb(port,1); delay(j); outportb(port,2); delay(j); outportb(port,4); delay(j); outportb(port,8); delay(j); outportb(port,16); delay(j); outportb(port,32); delay(j); outportb(port,64); delay(j); outportb(port,128); delay(j); } outportb(port,0); cprintf(" Request Completed... "); getch(); }
Privacy Policy
|
Link to Us
|
Links