Shop OBEX P1 Docs P2 Docs Learn Events
Requesting and Receiving Info from PINK — Parallax Forums

Requesting and Receiving Info from PINK

MikeSMikeS Posts: 131
edited 2007-08-20 04:24 in General Discussion
Hello,
I am trying to figure out the best way to convert PBasic_BS2·code·for the PINK module to SXB.

For example:
SEROUT PO,p_baud,[noparse][[/noparse]"!NB0W01:",DEC dat,CLS] 'send·data to PINK

I have SXB subroutines for transmitting (serout) the following types of data;
TX_BYTE··SUB·1···' transmit a byte
TX_STR··SUB·2···' transmit a string
TX_BIN··SUB·1, 3···' tx value in BIN format
TX_HEX··SUB·1, 3···' tx value in HEX format
TX_DEC··SUB·1, 3···' tx value in DEC format

I was thinking of doing something like this...

TX_STR "!NBOW01:"
TX_DEC dat
TX_STR "CLS"

I am a little confused about the CLS because it is a reserved word for the DEBUG command in PBASIC and it is highlighted in the PBASIC editor.

Any comments or suggestions would be appreciated.

MikeS

Comments

  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-19 15:25
    You should create constant in your program called CLS that has the value 13 (it's predefined in PBASIC); use TX_BYTE to send it.
  • MikeSMikeS Posts: 131
    edited 2007-08-19 21:43
    Jon,

    Thanks for the reply, BTW the code for CLS is 0. Carrage Return is 13.

    TX_STR "!NBOW01:"
    TX_DEC dat
    TX_BYTE CLS

    This works great!

    Thanks again

    MikeS
  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-20 04:24
    Sorry my mistake -- saw CLS, thought CR.
Sign In or Register to comment.