Add to Favorites    Make Home Page 882 Online  
 Language Categories  
 Our Services  

Home » C Home » Hardware Interaction Through C Home » PC Based Device Controller

A D V E R T I S E M E N T

Search Projects & Source Codes:

Title PC Based Device Controller
Author Ravichandran.M
Author Email mravichandran_karur [at] rediffmail.com
Description Controll Printer port using C
Category C » Hardware Interaction Through C
Hits 393697
Code Select and Copy the Code
Code : /* Computerised Electrical Equipment Control */ /* PC BASED DEVICE CONTROLLER */ #include<stdio.h> #include<conio.h> #include<dos.h> void main() { void tone(void); int p=0x0378; char ex[23]={"Created By Mrc"}; int j; char ex1[34]={"For Further Details & Improvements"}; int k; char ex2[43]={"Contact : E-mail : [email protected]"}; int l; char ex3[24]={"Programming Language : C"}; int m; int u[10]; int i; static a,b,c,d,e,f,g,h; char no; clrscr(); textcolor(15); gotoxy(20,6); cprintf("PC BASED DEVICE CONTROLLER"); textcolor(11); gotoxy(20,7); cprintf("~~~~~~~~~~~~~~~~~~~~~~~~~~"); textcolor(11); gotoxy(10,10); cprintf("Equipment Number: 1 2 3 4 5 6 7 8"); textcolor(11); gotoxy(10,12); cprintf("Status : %d %d %d %d %d %d %d %d",a,b,c,d,e,f,g,h); textcolor(10); gotoxy(9,16); cprintf("For 'ON' And 'OFF' An Equipment Press Corresponding Equipment Number"); textcolor(11); gotoxy(28,18); cprintf("Status 0 = OFF Status 1 = ON"); textcolor(12); gotoxy(32,20); cprintf("For EXIT Press 'E' "); no=getch(); switch(no) { case '1' : a=!a; tone(); outportb(p,1); delay(500); outport(p,0); break; case '2' : b=!b; tone(); outportb(p,2); delay(500); outport(p,0); break; case '3' : c=!c; tone(); outportb(p,4); delay(500); outport(p,0); break; case '4' : d=!d; tone(); outportb(p,8); delay(500); outport(p,0); break; case '5' : e=!e; tone(); outportb(p,16); delay(500); outport(p,0); break; case '6' : f=!f; tone(); outportb(p,32); delay(500); outport(p,0); break; case '7' : g=!g; tone(); outportb(p,64); delay(500); outport(p,0); break; case '8' : h=!h; tone(); outportb(p,128); delay(500); outport(p,0); break; case 'e' : if((a|b|c|d|e|f|g|h)==1) { clrscr(); textcolor(10); gotoxy(20,12); cprintf("Please SHUT DOWN All The Equipments"); sound(200); delay(500); nosound(); delay(3000); break; } else { clrscr(); for(j=0;j<23;j++) { textcolor(10); gotoxy(20+j,12); cprintf("%c",ex[j]); sound(3000+j); delay(30); nosound(); } for(m=0;m<23;m++) { textcolor(10); gotoxy(20+m,13); cprintf("%c",ex3[m]); sound(1800+m); delay(30); nosound(); } for(k=0;k<34;k++) { textcolor(10); gotoxy(20+k,14); cprintf("%c",ex1[k]); sound(2000+k); delay(30); nosound(); } for(l=0;l<40;l++) { textcolor(10); gotoxy(20+l,15); cprintf("%c",ex2[l]); sound(2500+l); delay(30); nosound(); } printf(" Press Any Key"); getch(); outportb(p,0); } case 'E' : if((a|b|c|d|e|f|g|h)==1) { clrscr(); textcolor(10); gotoxy(20,12); cprintf("Please SHUT DOWN All The Equipments"); sound(200); delay(500); nosound(); delay(3000); break; } else { clrscr(); for(j=0;j<23;j++) { textcolor(10); gotoxy(20+j,12); cprintf("%c",ex[j]); sound(2500+j); delay(30); nosound(); } for(m=0;m<24;m++) { textcolor(10); gotoxy(20+m,13); cprintf("%c",ex3[m]); sound(3500+m); delay(30); nosound(); } for(k=0;k<34;k++) { textcolor(10); gotoxy(20+k,14); cprintf("%c",ex1[k]); sound(3000+k); delay(30); nosound(); } for(l=0;l<43;l++) { textcolor(10); gotoxy(20+l,15); cprintf("%c",ex2[l]); sound(3500+l); delay(30); nosound(); } printf(" Press Any Key"); getch(); outportb(p,0); exit(0); } default : clrscr(); sound(500); delay(100); nosound(); textcolor(11); gotoxy(30,12); cprintf("Invalid Key Pressed"); textcolor(11); gotoxy(33,14); cprintf("Wait 2 Seconds"); delay(3000); break; } main(); } void tone(void) { sound(1000); delay(100); nosound(); }

Related Source Codes

Script Name Author
The Game Opposite as seen on Nokia 2300 Mobile Manikanta
RECURSIVE BALANCED QUICK SORT ashish
Radix Sort ashish
Change your mouse pointer Ashim
The blinking star Shashank
Data Validation Crylittlebaby
To search a file by giving file type like mp3 or mpeg or doc Prashanth SR
Menus Demonstration B.Chidhambaram
Employee Database Project Using C. Reenku Raman Nayak
Creating a Lexical Analyzer in c fahad bader al-buhairi �դ ?�� ��??���
Calendar Program Omkar & Devendra
Stop double Process for start in C Cedrik Jurak
Stop double Process for start in C Cedrik Jurak
Time Scheduler Atiq Anwar
A timepass game between atmost two players Rahul Roy

A D V E R T I S E M E N T




Google Groups Subscribe to SourceCodesWorld - Techies Talk
Email:

Free eBook - Interview Questions: Get over 1,000 Interview Questions in an eBook for free when you join JobsAssist. Just click on the button below to join JobsAssist and you will immediately receive the Free eBook with thousands of Interview Questions in an ebook when you join.

New! Click here to Add your Code!


ASP Home | C Home | C++ Home | COBOL Home | Java Home | Pascal Home
Source Codes Home Page

 Advertisements  

Google Search

Google

Source Codes World.com is a part of Vyom Network.

Vyom Network : Web Hosting | Dedicated Server | Free SMS, GRE, GMAT, MBA | Online Exams | Freshers Jobs | Software Downloads | Interview Questions | Jobs, Discussions | Placement Papers | Free eBooks | Free eBooks | Free Business Info | Interview Questions | Free Tutorials | Arabic, French, German | IAS Preparation | Jokes, Songs, Fun | Free Classifieds | Free Recipes | Free Downloads | Bangalore Info | Tech Solutions | Project Outsourcing, Web Hosting | GATE Preparation | MBA Preparation | SAP Info | Software Testing | Google Logo Maker | Freshers Jobs

Sitemap | Privacy Policy | Terms and Conditions | Important Websites
Copyright ©2003-2024 SourceCodesWorld.com, All Rights Reserved.
Page URL: http://www.sourcecodesworld.com/source/show.asp?ScriptID=1063


Download Yahoo Messenger | Placement Papers | Free SMS | C Interview Questions | C++ Interview Questions | Quick2Host Review