+ Reply to Thread
Results 1 to 2 of 2

Thread: BS2P to BS2

  1. #1

    Default BS2P to BS2

    Hi!

    I am trying to send a word from my BS2p to my BS2.

    Here´s the program for BS2p
    ' {$STAMP BS2p}
    ' {$PBASIC 2.5}

    t:
    SEROUT 2, 17405,["HELLO"]
    goto t

    here´s my BS2 program
    t:
    sdata VAR word
    SERIN 0, 16780, [sData]
    DEBUG sdata,CR
    PAUSE 1000
    GOTO t


    but all i get is a bunch of numbers or no recieve

    please help.

    regards
    Robban

  2. #2

    Default Re: BS2P to BS2

    WORD means something different from what you think. It refers to a 16-bit number, just like BYTE refers to an 8-bit number. Your SERIN in the BS2 program is expecting a number in the range of 0 to 65535. Normally, the SERIN would skip non-numeric characters until it sees the first digit and stop at the first non-digit after that.

    Look in the Basic Stamp Syntax and Reference Manual in the chapters on the SERIN and SEROUT statements for descriptions of what they can do, what kinds of data they can receiver and transmit, and how to write the various "formatters".

    Look particularly at the description of the STR formatter. Remember that the Stamps don't have real strings like what you'll find in PC versions of Basic. There's limited variable storage on the Stamps (a total of 26 bytes on the BS2) and each character of a string takes a byte. The BS2p has more storage, but it's a different area and not usable for variables. There's a way to receive bytes (SPSTR formatter) into this separate area and access them (GET and PUT statements), but it's not really a string variable.

+ Reply to Thread

Similar Threads

  1. bs2p
    By robots from azores in forum Robotics
    Replies: 5
    Last Post: 03-20-2009, 11:23 AM
  2. Replies: 29
    Last Post: 12-19-2005, 04:37 PM
  3. RUN 1 in BS2p
    By basicstampede in forum BASIC Stamp
    Replies: 1
    Last Post: 09-17-2004, 04:24 AM
  4. BS2p
    By Archiver in forum BASIC Stamps Archive
    Replies: 17
    Last Post: 04-10-2003, 09:15 AM
  5. GPS and BS2P
    By Archiver in forum BASIC Stamps Archive
    Replies: 6
    Last Post: 03-08-2001, 12:27 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts