wait without waiting
Ricky
Posts: 3
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
'--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
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
Ricky
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Post Edited (Chris Savage (Parallax)) : 3/26/2005 2:34:38 AM GMT
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 ***"]