Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

i need to acess parallel port though c for interfacing my project

mm Posts: 4Member
hi, i m just a beginner in c language, and i m making a logic controlled project, i m making a gaming machine using AND and OR gate, and i want to create user interface by connecting the hardware to computer via parallel port and like for instance, tht a question will be displayed on computer's screen like for instance " what is the capital of norway"
a-melbourne
b- sydney
c- oslo
d- bombay
so if user selects a then the message " sorry your answe is wrong"
and if user selects c logic 1 shoulg be transferred to pin 1 of AND gate to which we already have provided logic 1 so output will be 1 and then the questio will be displayed on screen " your gender"
i-male
ii- female
and if its male then send logic 1 to another circuitry and a gift will slide and if its female then some other gift will slide.
i m a beginner in c language and my teahcer told me tht outport function is used to acess parallel port, but i m not able to make a program , can u guyz help or refer a site or book considering i m just a beginner in programming

Comments

  • LundinLundin Posts: 3,711Member
    "outport" is an old obsolete non-standard function that won't work on Windows computers. So this program is not a task for a beginner.

    For info about the parallel port, check legacy ports at this site:

    http://www.beyondlogic.org/
  • mm Posts: 4Member
    cant i use windows98????
    and thnx for the link
  • Ed HallEd Hall Posts: 395Member
    Yes, Windows 98 will still allow access to the parallel port using either a console or Win32 interface. You will probably need to make sure the parallel port is set to bi-directional (standard) in the BIOS. Also, there are only five input lines (pins 15, 13, 12, 11, 10) and the last one is inverted. The output lines are pins 2 through 9. I always use a buffer IC to deal with the parallel port outputs when experimenting - the pins can only sink or source a small amount of current.

    To signal a particular pin simply change that bit within an eight bit number and send it to the port. Then clear the port when desired. Note that if you send two numbers sequentially to the port, there will be a clear in between, so a pin you have set with the first number and that will be set with the second number, will clear momentarily between the two numbers. For example, to set pin 5, with all others cleared, send the value 8 (00001000 binary) to the port using outport. When ready to clear, send 0.

    To read from the port, use inport.

    I can provide more info later, but I might be slow to respond. The best thing to do is research parallel port interfacing on the web.

    Take Care,
    Ed



Sign In or Register to comment.