Thread: Output to parallel port

  1. #1
    Registered User
    Join Date
    Jan 2003
    Posts
    14

    Output to parallel port

    I am trying to write a number to the parallel port data lines and when I use the following code, my program crashes.

    #include <conio.h>
    #define data 0x378

    scanf("%i",&bits);
    _outp(data,bits);

    Any ideas?

  2. #2
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826

    Re: Output to parallel port

    Originally posted by samuraijack
    I am trying to write a number to the parallel port data lines and when I use the following code, my program crashes.

    #include <conio.h>
    #define data 0x378

    scanf("%i",&bits);
    _outp(data,bits);

    Any ideas?
    Wow. You're lucky it compiles. You don't even have a main function...

    Quzah.
    Hope is the first step on the road to disappointment.

  3. #3
    Registered User
    Join Date
    Jan 2003
    Posts
    14
    I do have a main function, I just didn't think that I needed to put that in aswel.

    #include <conio.h>
    #define data 0x378

    int main(void)
    {
    scanf("%i",&bits);
    _outp(data,bits);
    }

    Any ideas?
    Last edited by samuraijack; 01-27-2003 at 03:18 AM.

  4. #4
    Registered User
    Join Date
    Jan 2003
    Posts
    14
    I have been looking into this one and have found out that because I am using Windows NT 4 I can not just use the windows drivers and must make my own with windows DDK.

    Before I begin does anybody know of a way around this?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Parallel Port IO ops not working properly
    By microtechno in forum Linux Programming
    Replies: 16
    Last Post: 06-08-2009, 12:33 PM
  2. problem interfacing in parallel port
    By tariq7868 in forum C Programming
    Replies: 4
    Last Post: 06-08-2009, 03:53 AM
  3. Parallel Port to USB controller and outb()
    By coletek in forum Linux Programming
    Replies: 1
    Last Post: 06-05-2009, 06:57 AM
  4. programming the parallel port to control device
    By griffmaster2005 in forum C Programming
    Replies: 3
    Last Post: 02-14-2005, 07:50 AM
  5. Full control of parallel port?
    By The V. in forum Windows Programming
    Replies: 1
    Last Post: 10-28-2001, 03:24 PM