Howdy, Stranger!

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

Categories

how to acces lpt port via c++

gercekigerceki Member Posts: 4
i don't know how to access the data chanells in the pt port
is there any function for that and what is the library that it is in
how can i use it?
thanks for your help

Comments

  • Will_SantanaWill_Santana Member Posts: 20
    : i don't know how to access the data chanells in the pt port
    : is there any function for that and what is the library that it is in
    : how can i use it?
    : thanks for your help
    :

    I've been working with the LPT for a long time. You can access the pa port using the old C functions:

    inp()
    inport()
    inportb()
    for reading from the port

    outp()
    outport()
    outportb()
    for writting to the port

    Most of this functions are supported by C++ compilers.
    But if you want to work under windows, you're playing with fire.
    Although Win9x allows you to writte directly to any hardware port, it's not fine. Windows uses the virtual machines system. And you should use it to access the pa port.
    It's not easy! And some port modes (as PS/2 - even called byte mode) seens to not be supported by windows.

    You can download Win9x DDK (drivers developers kit) from MS page for more information about it.

    But if you'll anly use a console application, those old functions should be all you need.

    Lots of info about pa port (and others) can be found at:
    http://www.beyondlogic.org/

    Hope it helps

    Will Santana

  • gercekigerceki Member Posts: 4
    : : i don't know how to access the data chanells in the pt port
    : : is there any function for that and what is the library that it is in
    : : how can i use it?
    : : thanks for your help
    : :
    :
    : I've been working with the LPT for a long time. You can access the pa port using the old C functions:
    :
    : inp()
    : inport()
    : inportb()
    : for reading from the port
    :
    : outp()
    : outport()
    : outportb()
    : for writting to the port
    :
    : Most of this functions are supported by C++ compilers.
    : But if you want to work under windows, you're playing with fire.
    : Although Win9x allows you to writte directly to any hardware port, it's not fine. Windows uses the virtual machines system. And you should use it to access the pa port.
    : It's not easy! And some port modes (as PS/2 - even called byte mode) seens to not be supported by windows.
    :
    : You can download Win9x DDK (drivers developers kit) from MS page for more information about it.
    :
    : But if you'll anly use a console application, those old functions should be all you need.
    :
    : Lots of info about pa port (and others) can be found at:
    : http://www.beyondlogic.org/
    :
    : Hope it helps
    :
    : Will Santana
    :

    Thanks for that
    ı was using borland 5.5 c++ compiler and it wasn't supporting that functions
    now ı am using an older version of it my code works now :))


  • Z0diacZ0diac Member Posts: 5
    if you are still alive...
    if you want to light leds, buy 8 leds and put only the + of the leds in the holes of the lpt.These holes are 2-9 pins(the lpt adaptor has numbers on it).The - port of the led put it on the iron that surround the adaptor.There the voltage is 0.You can now compile this code in order to light all the connected leds:

    #include
    #include
    #include

    int main()
    {
    _outp(0x378 , 255)
    return 0;
    }

    255(decimal) = 11111111(binary)
    if you want to light only the first led write instead of 255
    1(decimal) = 00000001(binary)
    if you want to light the third led:
    4(decimal) = 00000100(binary)

    i hope you understand.


  • gercekigerceki Member Posts: 4
    : if you are still alive...
    : if you want to light leds, buy 8 leds and put only the + of the leds in the holes of the lpt.These holes are 2-9 pins(the lpt adaptor has numbers on it).The - port of the led put it on the iron that surround the adaptor.There the voltage is 0.You can now compile this code in order to light all the connected leds:
    :
    : #include
    : #include
    : #include
    :
    : int main()
    : {
    : _outp(0x378 , 255)
    : return 0;
    : }
    :
    : 255(decimal) = 11111111(binary)
    : if you want to light only the first led write instead of 255
    : 1(decimal) = 00000001(binary)
    : if you want to light the third led:
    : 4(decimal) = 00000100(binary)
    :
    : i hope you understand.
    :
    :
    thank you for that respond to my problem .yes ı know about that binary - decimal algorithm
    my problem was just about the compiler it was pointing an error about that function _outp()but ı came over it
    thank you again for your respond


Sign In or Register to comment.