help with using parallel port

i want to interface a simple buzzer circuit with a parallel port for a quiz like competition.
we've decided to use a comp instead of going the hardware way...

i would need sum graphic output to display via projector, the team number which presses their buzzer first.

i guess vb would be a good language as i want it to be simple...
i hav no prior idea abt vb:S
i have learnt c/c++ and can use them, but have no idea abt displaying numbers graphically(big enuf to be read by a classroom full of ppl...)or using parallel port..

any help abt vb compilers/tutorials or abt parallel port programming is welcome

tia
 
Programming the parallel port is very simple. But finally interfacing it isn't. This tutorial here is very good and explains everything one needs

Parallel port interfacing tutorial: with C - e l e c t r o S o f t s . c o m

You need to unlock the parallel port first in Windows XP or else you will not get the correct results. Try searching for a software called Userport. If you cannot find it PM me and I will send it to you.

Also you will need a 25 pin male connector for the interfacing. Make sure that pins 18-25 are connected to ground (just shorting them will help) which is usually the difficult part. Once you have the connector ready everything else is a breeze.

Though the tutorial is in C, interfacing in vb is also quite simple. You will need the connector, and unlock the parallel port anyway.

After that you will have to take an input via one of the bidirectional pins of the parallel port, check its value from your program and display the number accordingly. You will have to pass +5V to a pin to take input. You will also have to decide on how do you plan to make the circuit that will give the input to the parallel port.
 
^thanks...i got userport 1.0...

can u tell me that if i set the port's data lines d0 to d7 as input, will all the lines go to +5v automatically....

i dont know u can even do this, but this is what would happen in 8051, which i am studying...

assuming the above does happen, what id planned was to connect the respective line to ground whenever any team presses their buzzer...
i can also connect it to vcc if required...that depends on the nature of the port...
there will be a common buzzer that will be connected to all switches, and will ring whenever any switch is pressed..

as for the male connector, that can be obtained fron lamington i guess...
 
can u tell me that if i set the port's data lines d0 to d7 as input, will all the lines go to +5v automatically....

If you set the port's output then only those pins will give an output of +5V.

If you give +5V input to one of the pins it will be considered as logic 1 input (other than pins 1, 11, 14 & 17).

You can use a circuit that will give a +5V (usually taken as vcc) and provide with a ground. That circuit can be easily made using the IC LM7805C and some capacitors.

Alternatively you can use any adaptor that gives an output of +5V (which are difficult to find).

You can also use 8051 or any other microcontroller to interface the whole thing. They also work in a similar manner, they give a physical output of +5V when you program it to output logic 1 and consider physical input of +5V as logic 1.

Personally I suggest you to use the AVR series microcontroller (Atmega 8 or Atmega 16) if you are really interested in microcontrollers.

But use 8051 only in case you want hardware to play the sound for you (speakers and all). Otherwise you can easily do the project without 8051 by playing the sound from the PC.

assuming the above does happen, what id planned was to connect the respective line to ground whenever any team presses their buzzer...

Please clarify.

An alternate solution would be connecting the output of team 1 to parallel port input d0, team 2 to d1 and so on. If the buzzer is pressed, the input passed to corresponding pin will be 1. You can simple use conditional statements to check which team's input is 1 and display its number.

You can get the male connector from any compuer market like Nehru Place.
 
hammerhead said:
An alternate solution would be connecting the output of team 1 to parallel port input d0, team 2 to d1 and so on. If the buzzer is pressed, the input passed to corresponding pin will be 1. You can simple use conditional statements to check which team's input is 1 and display its number.

this is more or less what id thought of....
im not using 8051 for this...if i do, i wouldnt have needed the pc at all....
sound will be played by a common buzzer connected to the 8 switches via hardware...

and even i had thot of using 7805s for the 5v...even have a couple lying around...

i must ask....would it be advisable to use visual studio....considering im no programming freak....and have never used visual studio before...
im asking coz i found some example code written in vc++ and they had taught how to run it in visual studio...

one more thing...should i learn vb, or would i be better off in vc++, or simply c??.....considering i need to display numbers in large size....and i have no idea how to do that in any language...
 
Handling the GUI is simpler and looks good on visual studio. I have never programmed parallel port in either vb, C# or vc++ but I get it shouldn't be very difficult.

I suggest you try C#.NET. The syntax is similar to that of C++ and handling the GUI is easy. All you need to do is paste a huge label on the form and set its text property to that of the team number.
You will have to learn very little of creating a form, setting properties and using conditional statements. That task is very very simple and can easily be done in a couple of hours. Try searching for parallel port interfacing in C#.net and go through this post.
Programming the parallel port help!!! - MSDN Forums
 
thanks a lot...
got the setup working with just userport and a simple c program...
displaying numbers on screen by increasing fontsize thru "properties" in the window of the exe..
centering using gotoxy (the only command i know frm graphics.h)

btw...for i/p, unconnected status of lines is vcc...so we jus have to ground the lines on which 0 is needed....makes the whole thing a lot simpler...no need for 7805
 
Thanks for the info. Also you may want to consider using settextstyle() and outtextxy() to display the text in C. You can set the font and font size using these two functions makes the text looks good. However if your purpose is solved there is no need.
 
Back
Top