Professional Documents
Culture Documents
Introduction: - PC parallel port can be very useful I/O channel for connecting our own circuits to PC. The
PC's parallel port can be used to perform some very amusing hardware interfacing experiments. The port is
very easy to use when we first understand some basic tricks.
NOTE:1. Before connecting hardware isolate our hardware and parallel port by isolate example optocoupler.
2. Install software for input and output interfacing example port95.exe.
CIRCUIT DIAGRAM:-
96. outtextxy(150,200,"ON");
97. }
98. else
99. {
100.
outtextxy(150,200,"OFF");
101.
}
102.
if(1==g%2)
103.
{
104.
outtextxy(150,250,"ON");
105.
}
106.
else
107.
{
108.
outtextxy(150,250,"OFF");
109.
}
110.
if(1==f%2)
111.
{
112.
outtextxy(150,300,"ON");
113.
}
114.
else
115.
{
116.
outtextxy(150,300,"OFF");
117.
}
118.
if(1==d%2)
119.
{
120.
outtextxy(150,350,"ON");
121.
}
122.
else
123.
{
124.
outtextxy(150,350,"OFF");
125.
}
126.
if(1==s%2)
127.
{
128.
outtextxy(150,400,"ON");
129.
}
130.
else
131.
{
132.
outtextxy(150,400,"OFF");
133.
}
134.
setcolor(9);
135.
outtextxy(50,450,"ENTER 'b' FOR BACK WINDOW");
136.
outtextxy(50,50,"PRES q");
137.
outtextxy(50,100,"PRES w");
138.
outtextxy(50,150,"PRES e");
139.
outtextxy(50,200,"PRES r");
140.
outtextxy(50,250,"PRES t");
141.
outtextxy(50,300,"PRES y");
142.
outtextxy(50,350,"PRES u");
143.
outtextxy(50,400,"PRES i");
144.
145.
146.
147.
148.
149.
150.
151.
152.
153.
154.
155.
156.
157.
158.
159.
160.
161.
162.
163.
164.
165.
166.
167.
168.
169.
170.
171.
172.
173.
174.
175.
176.
177.
178.
179.
180.
181.
182.
183.
184.
185.
186.
187.
188.
189.
190.
191.
u=getche();
switch(u)
{
case 'q':
if(0==l%2)
{
int o1=0;
o1=inp+1;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-1;
outportb(0x378,o1);
}
l++;
break;
case 'w':
if(0==k%2)
{
int o1=0;
o1=inp+2;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-2;
outportb(0x378,o1);
}
k++;
break;
case 'e':
if(0==j%2)
{
int o1=0;
o1=inp+4;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-4;
outportb(0x378,o1);
}
j++;
break;
192.
193.
194.
195.
196.
197.
198.
199.
200.
201.
202.
203.
204.
205.
206.
207.
208.
209.
210.
211.
212.
213.
214.
215.
216.
217.
218.
219.
220.
221.
222.
223.
224.
225.
226.
227.
228.
229.
230.
231.
232.
233.
234.
235.
236.
237.
238.
239.
case 'r':
if(0==h%2)
{
int o1=0;
o1=inp+8;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-8;
outportb(0x378,o1);
}
h++;
break;
case 't':
if(0==g%2)
{
int o1=0;
o1=inp+16;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-16;
outportb(0x378,o1);
}
g++;
break;
case 'y':
if(0==f%2)
{
int o1=0;
o1=inp+32;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-32;
outportb(0x378,o1);
}
f++;
break;
case 'u':
if(0==d%2)
{
240.
241.
242.
243.
244.
245.
246.
247.
248.
249.
250.
251.
252.
253.
254.
255.
256.
257.
258.
259.
260.
261.
262.
263.
264.
265.
266.
267.
268.
269.
270.
271.
272.
273.
274.
275.
276.
277.
278.
279.
280.
281.
282.
283.
284.
285.
286.
287.
int o1=0;
o1=inp+64;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-64;
outportb(0x378,o1);
}
d++;
break;
case 'i':
if(0==s%2)
{
int o1=0;
o1=inp+128;
outportb(0x378,o1);
}
else
{
int o1=0;
o1=inp-128;
outportb(0x378,o1);
}
s++;
break;
case 'b':
goto b;
break;
}
goto p;
break;
case 'y':
m:
cleardevice();
outtextxy(50,250,"ENTER 'b' FOR BACK WINDOW");
u=getche();
if(u=='b')
{
goto b;
}
else
{
goto m;
}
break;
case 'z':
288.
289.
290.
291.
292.
293.
294.
295.
296.
297.
298.
299.
300.
cleardevice();
setcolor(1);
settextstyle(7,0,5);
outportb(0x378,0x00);
outtextxy(200,200,"THANK YOU");
delay(1000);
closegraph();
exit(0);
break;
default:
goto b;
}
}
SATP2:
STEP3:
STEP4: