Shop OBEX P1 Docs P2 Docs Learn Events
wait without waiting — Parallax Forums

wait without waiting

RickyRicky Posts: 3
edited 2005-03-26 16:54 in BASIC Stamp
here is whats going on, I would like my code to continue to execute while waiting for my serial data to show up. Here is my code:

'--get current gps info--
SERIN GPSpin,N4800,[noparse][[/noparse]WAIT("$GPRMC"),SPSTR 65]
GOSUB Parse_GPS
DEBUG "Location Recieved",CR
'--get current waypoint info--
SERIN GPSpin,N4800,[noparse][[/noparse]WAIT("$GPRMB"),SPSTR 65]
GOSUB Parse_Waypoint
DEBUG "Waypoint Recieved",CR


as you know the code will 'wait' and do nothing else untill it sees $GPRMC how can i keep going while also waiting for that string?

DO WHILE ?

btw that string will show up about every 2 seconds on the GPSpin


BS2p 2.5


Thanks for any help,
Ricky

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-03-25 11:11
    Ricky -

    The waiting that you're looking to do can be done by a co-processor so that the Stamp can continue along its way until such time as you actually NEED that specific data. The following co-processor has a byte-match facility which should act in a similar manner to the Stamp SERIN WAIT sub-parameter:
    http://www.protean-logic.com/tickit/rsb509B_HTML_Cutsheet.htm

    Regards,

    Bruce Bates
  • RickyRicky Posts: 3
    edited 2005-03-25 14:47
    thanks for your quick reply, i will look into your link.


    Ricky
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-26 02:29
    ·· You can also use the timeout feature of SERIN to let the code continue, then recheck after executing the loop again.· Please see the help file for details.· Of course, you won't be able to "WAIT," so you would maybe have to load your data into scratchpad and parse it from there.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com

    Post Edited (Chris Savage (Parallax)) : 3/26/2005 2:34:38 AM GMT
  • RickyRicky Posts: 3
    edited 2005-03-26 16:54
    this is working great here

    Thanks,
    Ricky


    '--get current gps info--
    SERIN GPSpin,N4800,2000,NoData,[noparse][[/noparse]WAIT("$GPRMC"),SPSTR 65]
    GOSUB Parse_GPS
    DEBUG "Location Recieved",CR
    SEROUT 10,n9600,[noparse][[/noparse]I,CLR,L1_0,"*** GPS RX 1 ***"]
    '--get current waypoint info--
    SERIN GPSpin,N4800,2000,NoData,[noparse][[/noparse]WAIT("$GPRMB"),SPSTR 65]
    GOSUB Parse_Waypoint
    DEBUG "Waypoint Recieved",CR
    SEROUT 10,n9600,[noparse][[/noparse]I,CLR,L1_0,"*** GPS RX 2 ***"]
Sign In or Register to comment.