Shop OBEX P1 Docs P2 Docs Learn Events
Sending multiple variables over SEROUT command? — Parallax Forums

Sending multiple variables over SEROUT command?

DmitriyDmitriy Posts: 7
edited 2007-05-17 21:07 in BASIC Stamp
I am using a BS2p chip with a SFE ER-301 GPS unit.
Using the basic AEROGPS code provided in http://www.parallax.com/dl/docs/article/rambal-gps.pdf, I am able to get it to output some of the information I need.
Currently the output over the DEBUG screen is:
46:20:38.9,S,040:56:31.6,W
using an DEBUG code of:
DEBUG DEC2 laDeg,":",DEC2 laMin,":",DEC2 laSec / 10,".",DEC1 laSec // 10,Comma,"N" + (laNS * 5),Comma,DEC3 loDeg,":",DEC2 loMin,":",DEC2 loSec / 10,".",DEC1 loSec // 10,Comma,"E" + (loEW * 18),CR



How can I get the same output to transmit back over the serial cable?

I have tried the SEROUT command, but cannot get the same output to appear.· Single variable are easy to do using SEROUT 16, 240 [noparse][[/noparse]laDeg], but not having any luck matching to the DEBUG output.


TIA

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-05-14 20:16
    Hello,

    What is the code you’re currently using to send the same data serially?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • DmitriyDmitriy Posts: 7
    edited 2007-05-14 20:42
    The purpose of the basic stamp is to send two converted digital signals from an LTC 1298 PIC and the GPS data over 1 stream.

    I've attached the combined and individual scripts.

    TIA
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2007-05-14 21:46
    It should be the same format as DEBUG. The following should act exactly the same as the successful debug.

    SEROUT 16,$F0,[noparse][[/noparse] DEC2 laDeg,":",DEC2 laMin,":",DEC2 laSec / 10,".",DEC1 laSec ,Comma,"N" + (laNS * 5),Comma,DEC3 loDeg,":",DEC2 loMin,":",DEC2 loSec / 10,".",DEC1 loSec ,Comma,"E" + (loEW * 18),CR]


    The // 10 after DEC1 is not necessary. It is implied.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
  • DmitriyDmitriy Posts: 7
    edited 2007-05-17 19:22
    So the $F0 just tells it to "get" the variable values from ROM?
  • phil kennyphil kenny Posts: 233
    edited 2007-05-17 20:55
    Dmitriy said...
    So the $F0 just tells it to "get" the variable values from ROM?

    No. $F0 is the hex equivalent of 240 decimal. It is the baud rate setting
    for SEROUT.

    phil
  • DmitriyDmitriy Posts: 7
    edited 2007-05-17 21:07
    Thanks, it works fine now.
Sign In or Register to comment.