Results 1 to 3 of 3

Thread: working with lpt

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    222

    working with lpt

    How do I send the commands to lpt in winnt-xp
    like _outp,_outd

  2. #2
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594

    Re: working with lpt

    Do you want to talk to the parallel port or to a printer?

    Try opening the file "LPT1:" and writing to it.
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Mar 2004
    Posts
    222

    Re: working with lpt

    As the following codes but that works only with win9x.









    # include <dos.h>

    main( )

    {

    int i = 0 ;

    unsigned char seg[ ] = {

    64 | 1 | 2 | 4 | 16 | 32, /* 0 */

    16 | 4, /* 1 */

    32 | 16 | 128 | 1 | 2, /* 2 */

    32 | 16 | 128 | 4 | 2, /* 3 */

    64 | 128 | 16 | 4, /* 4 */

    32 | 64 | 128 | 4 | 2, /* 5 */

    32 | 64 | 1 | 2 | 4 | 128, /* 6 */

    32 | 16 | 4, /* 7 */

    32 | 64 | 128 | 4 | 2 | 1 | 16, /* 8 */

    32 | 64 | 128 | 16 | 4 | 2 /* 9 */

    } ;

    while ( ! kbhit( ) )

    {

    outportb ( 0x378, seg[ i ] ) ;

    delay ( 1000 ) ;

    i++ ;

    if ( i == 10 )

    i = 0 ;

    }

    outportb ( 0x378, 0 ) ;

    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width