Shop OBEX P1 Docs P2 Docs Learn Events
GPS with Parallax Serial Terminal Object — Parallax Forums

GPS with Parallax Serial Terminal Object

bingobingo Posts: 10
edited 2013-03-05 14:45 in Accessories
Hello,

Would someone please tell me what’s wrong with this code. The GPS module puts out a single ASCII string once per second. I have double checked all pins, baud rates, ports etc.
I get no response on the terminal.

Comments

  • John AbshierJohn Abshier Posts: 1,116
    edited 2013-03-05 13:19
    You need to use two Parallax Serial Terminal objects. Something like this (not tested but does compile)
    VAR
      byte MyString[60]
    
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    OBJ
      pst : "Parallax Serial Terminal"
      pstGPS : "Parallax Serial Terminal"
      
    PUB start | ok
    
    dira[14] := 0                            ' Set Rx pin to input.
    
      pst.start(115200)                      ' Start Parallax serial terminal.
    
      pstGPS.StartRxTx(14, 15, 0, 4800)         ' Set up for GPS transfer.
      repeat
        pstGPS.StrInMax(@MyString, 10)          ' Start GPS transrer.
        pst.str(@MyString)                        
        waitcnt(clkfreq + cnt)
    

    John Abshier
  • bingobingo Posts: 10
    edited 2013-03-05 14:45
    Wow, John that really worked. I spent 2 days trying to get a result. Many Thanks
Sign In or Register to comment.