Thread: _bios_serialcom HELP!!!

  1. #1
    NoIdea
    Guest

    Angry _bios_serialcom HELP!!!

    Using _bios_serialcom how would i send a command (eg. "LTD\r") in one go?

    I've tried putc, putch but so far can only achieve it in the most repeatetive way

    _bios_serialcom(_COM_SEND, COM2, 'L');
    _bios_serialcom(_COM_SEND, COM2, 'T');
    _bios_serialcom(_COM_SEND, COM2, 'D');
    _bios_serialcom(_COM_SEND, COM2, '\r');

    which is obviously a waste of time & code.


    TIA!!!!

  2. #2
    Noidea
    Guest

    Thumbs down

    BTW, i'm using Borland Turbo C++ 3.0 DOS

  3. #3
    Disagreeably Disagreeable
    Join Date
    Aug 2001
    Posts
    711
    Write a function that sends a string. Hint: Use a loop. Another hint: You _may_ have to pause a short amount of time between each write, depending on how fast your computer is and how fast your serial port can send.

  4. #4
    Someidea
    Guest

    Smile

    i just found that the following works perfectly.

    for(i=0; cmd[i]; i++)
    _bios_serialcom(_COM_SEND, COM2, cmd[i]);

Popular pages Recent additions subscribe to a feed