Shop OBEX P1 Docs P2 Docs Learn Events
Programming help ( Serin) — Parallax Forums

Programming help ( Serin)

ArchiverArchiver Posts: 46,084
edited 2004-04-22 23:14 in General Discussion
Hi all,
does anyone know how to use the command "SERIN" to extract the string of
data through a pin on BS2 from the GPS that is interfaced on BS2?

thanks for your help

Jeff

_________________________________________________________________
MSN Toolbar provides one-click access to Hotmail from any Web page – FREE
download! http://toolbar.msn.com/go/onm00200413ave/direct/01/

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 23:01
    --- In basicstamps@yahoogroups.com, "Wu MengChe" <mengche@h...> wrote:
    > Does anyone know how to use the command "SERIN" to extract the
    > string of data through a pin on BS2 from the GPS that is
    > interfaced on BS2?

    The Basic Stamp Programming Manual that I saw (v2.0c) gave lots of
    information and examples in the section on SERIN. Not knowing the
    output format of your GPS device, there's no way that anyone here can
    give you specific information.

    If you don't have the manual, you can get it here:
    http://www.parallax.com/dl/docs/prod/stamps/BasicStampMan.pdf
  • ArchiverArchiver Posts: 46,084
    edited 2004-04-22 23:14
    Hello,
    Here is a code that was done a while ago, it's not commented but
    it does work. It should help you.

    '{$STAMP BS2}
    '{$PBASIC 2.0}
    'Setup for TRIPMATE GPS system
    'reads 16 bytes of data each time via the $GPRMC mode
    bytearray VAR Byte(16)
    x VAR Byte
    x1 VAR Byte
    x2 VAR Byte
    x3 VAR Byte
    x4 VAR Byte
    x5 VAR Byte
    t VAR Byte
    t1 VAR Byte
    t2 VAR Byte
    t3 VAR Byte
    HIGH 9

    start:
    SERIN 8,188+$4000,60000,nodata,[noparse][[/noparse]WAIT("$GPRMC"), STR bytearray\16]
    DEBUG STR bytearray\16,CR
    x=bytearray(10)
    x1=bytearray(11)
    x2=bytearray(12)
    x3=bytearray(13)
    t=bytearray(1)
    t1=bytearray(2)
    t2=bytearray(3)
    t3=bytearray(4)
    x4=bytearray(5)
    x5=bytearray(6)
    DEBUG "Time ",STR t\1,STR t1\1,":",STR t2\1,STR t3\1,":",STR x4\1,STR
    x5\1," GMT",CR

    SERIN 8,188+$4000,60000,nodata,[noparse][[/noparse]WAIT("$GPRMC"), STR bytearray\16,STR
    bytearray\16]
    x4= bytearray(4)
    DEBUG STR bytearray\16,CR
    DEBUG "Latitude ",STR x4\1,STR x\1,STR x1\1,223,STR x2\1,STR x3\1,CR

    x=bytearray(6)
    x1=bytearray(7)
    x2=bytearray(8)
    x3=bytearray(9)
    x4=bytearray(10)
    SERIN 8,188+$4000,60000,nodata,[noparse][[/noparse]WAIT("$GPRMC"), STR bytearray\16,STR
    bytearray\16,STR bytearray\16]
    DEBUG STR bytearray\16,CR
    x5=bytearray(1)

    DEBUG "Longitude ",STR x5\1,STR x\1,STR x1\1,STR x2\1,223,STR x3\1,STR
    x4\1,CR

    x=bytearray(12)
    x1=bytearray(13)
    x2=bytearray(14)
    x3=bytearray(15)
    SERIN 8,188+$4000,60000,nodata,[noparse][[/noparse]WAIT("$GPRMC"), STR bytearray\16,STR
    bytearray\16,STR bytearray\16,STR bytearray\16\"*"]
    DEBUG STR bytearray,CR
    IF x="," THEN cc
    IF x1="," THEN aa
    x=x3
    x1=bytearray(0)
    t=bytearray(1)
    t1=bytearray(2)
    t2=bytearray(3)
    t3=bytearray(4)
    GOTO bb
    aa:
    x=x2
    x1=x3
    t=bytearray(0)
    t1=bytearray(1)
    t2=bytearray(2)
    t3=bytearray(3)
    GOTO bb
    cc:
    x=x1
    x1=x2
    t=x3
    t1=bytearray(0)
    t2=bytearray(1)
    t3=bytearray(2)
    bb:
    DEBUG "Date ",STR t\1,STR t1\1,"/",STR x\1,STR x1\1,"/",STR t2\1,STR
    t3\1,CR
    GOTO start
    nodata:
    DEBUG "bad connection?",CR
    GOTO start
    Stephen Swanson
    Technical Support Manager
    Parallax, Inc.
    599 Menlo Drive, #100
    Rocklin, CA 95765

    Phone (916) 624-8333
    E-mail ..... sswanson@p...
    Main site...... www.parallax.com
    Educational site.... www.parallax.com/sic
    Javelin Stamp... www.parallax.com/javelin


    Original Message
    From: Wu MengChe [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=2e6xLjk_45-oPS6trMcvbeXyvrbeQO9T5ow0fZlrI4bcAC22EnkfqTR2dHH6GLq0P2vqGEgQRuhKrnk]mengche@h...[/url
    Sent: Thursday, April 22, 2004 9:44 AM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Programming help ( Serin)



    Hi all,
    does anyone know how to use the command "SERIN" to extract the string of


    data through a pin on BS2 from the GPS that is interfaced on BS2?

    thanks for your help

    Jeff

    _________________________________________________________________
    MSN Toolbar provides one-click access to Hotmail from any Web page -
    FREE
    download! http://toolbar.msn.com/go/onm00200413ave/direct/01/




    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.

    Yahoo! Groups Links







    This message has been scanned by WebShield. Please report SPAM to
    abuse@p....
Sign In or Register to comment.