interfacing the serial port

How can i program C to interface the serial port


Comments

  • : How can i program C to interface the serial port

    :






  • : How can i program C to interface the serial port

    :



    From Borland's C++ "Library Reference":



    outputs a byte to a hardware port ...



    #include

    #include



    int main(void)

    {

    unsigned port = 0;

    int value;



    int value = outp(port, 'C');

    printf("Value %c sent to port number %d
    ", value, port);

    return 0;

    }

    hmmmmm... This probably isn't what you want. You probably want to stream data in and out of the port. The same reference has an example for the bioscom() library function that reads the status of the serial port and sends keyboard hits to it, but it is too lengthly to put here. Besides, it will be different for different compilers. You will have to check the docs that came with your compiler. Hope this helps a little.



    Enjoy!

    Al










Sign In or Register to comment.

Howdy, Stranger!

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

Categories