Shop OBEX P1 Docs P2 Docs Learn Events
Need BS2 to talk to QBASIC via serial port — Parallax Forums

Need BS2 to talk to QBASIC via serial port

ArchiverArchiver Posts: 46,084
edited 2003-02-21 05:50 in General Discussion
Hello

I need a data gathering BS2 to send a byte of data via serial to a PC
(Win 95 with QBASIC - yes its old but it works, or use to. ;-).

BS2 Port 4 goes direct to pin 2 on the D-9 of the serial port. Ground
is common, and on the D-9 pins 6 and 7 (DSR and RTS) are bridged
together.

BS2 code:
SEROUT 4,16468,[noparse][[/noparse]databyte]

QBASIC code:
OPEN "COM2:9600,N,8,1,CD0,CS0,DS0,OP0" FOR INPUT AS #1
...
INPUT #1, DBYTE

but this does not work... it just sits there.

Any help appreciated.

Roger

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2003-02-21 05:50
    I believe the Qbasic comand "input" inputs data until a Carraige Return is
    returned. Your option would be to make sure the stamp appends a CR on the
    end or use the INPUT$(x,y) command:
    e.g.
    DBYTE = INPUT$(2,1) tells qbasic to input 2 bytes from file/com #1

    Hope this helps.

    Original Message
    From: <rogermondo@y...>
    To: <basicstamps@yahoogroups.com>
    Sent: Wednesday, February 19, 2003 11:33 AM
    Subject: [noparse][[/noparse]basicstamps] Need BS2 to talk to QBASIC via serial port


    > Hello
    >
    > I need a data gathering BS2 to send a byte of data via serial to a PC
    > (Win 95 with QBASIC - yes its old but it works, or use to. ;-).
    >
    > BS2 Port 4 goes direct to pin 2 on the D-9 of the serial port. Ground
    > is common, and on the D-9 pins 6 and 7 (DSR and RTS) are bridged
    > together.
    >
    > BS2 code:
    > SEROUT 4,16468,[noparse][[/noparse]databyte]
    >
    > QBASIC code:
    > OPEN "COM2:9600,N,8,1,CD0,CS0,DS0,OP0" FOR INPUT AS #1
    > ...
    > INPUT #1, DBYTE
    >
    > but this does not work... it just sits there.
    >
    > Any help appreciated.
    >
    > Roger
    >
    >
    >
    > To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    > from the same email address that you subscribed. Text in the Subject and
    Body of the message will be ignored.
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
Sign In or Register to comment.