Shop OBEX P1 Docs P2 Docs Learn Events
a GOSUB in between 2 SEROUTs? — Parallax Forums

a GOSUB in between 2 SEROUTs?

ice-egozice-egoz Posts: 55
edited 2004-09-13 02:05 in BASIC Stamp
is this possible?after i tested out.. it doesnt go anywhere after displaying the GPS data.

SEROUT toModem, baud, [noparse][[/noparse]"The Car is at"]
GOSUB retrieve_GPS· 'missing information in signal_valid section.
SEROUT toModem, baud, [noparse][[/noparse]"Shall I shut down the car?"]'and send a SMS, MSG Successful.
SEROUT toModem, baud, [noparse][[/noparse]26]······················· 'equivalent to '='

retrieve_GPS:
PAUSE 2000
Draw_Ruler:
··· FOR index = 0 TO 65
··· 'statement for tens
··· IF ((index // 10) = 0) AND ((index /10) > 0) THEN
····· DEBUG CRSRXY, (7 + index), 3, DEC1 (index / 10)
··· ENDIF
··· 'statement for ones
··· DEBUG CRSRXY, (7 + index), 4, DEC1 (index // 10)
··· ' ticks
··· IF (index // 10 = 0) THEN
····· DEBUG CRSRXY, (7 + index), 5, "|"
··· ENDIF
··· NEXT
retrieve_GPS1:
· SERIN GPSpin, BaudMode, 3000, retrieve_GPS, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]
· GOSUB Parse_GPS_Data
Show_Report:
··· DEBUG CRSRXY, 14, 8
··· LOOKUP valid, [noparse][[/noparse]NotValid, IsValid], eeAddress
··· GOSUB Print_Z_String
··· DEBUG CLREOL
··· IF (valid = 0) THEN Signal_Not_valid
Signal_Is_Valid:
··· DEBUG " 20", DEC2 year,
········· CRSRXY, 15, 13, DEC2 latitudeDeg, DegSym, " ", DEC2 latitudeMin, MinSym, " ",
········· DEC2 (latitudeSec / 10), ".", DEC1 (latitudeSec // 10), SecSym, " ",
········· "N" + (latitudeNS * 5)
··· 'for smsing the·information
··· SEROUT toModem,baud, [noparse][[/noparse]latitudeDeg+latitudeMin+(latitudeSec / 10)+(latitudeSec // 10)+(latitudeNS * 5)]
··· DEBUG CRSRXY, 14, 14, DEC3 longitudeDeg, DegSym, " ", DEC2 longitudeMin, MinSym, " ",
········· DEC2 (longitudeSec / 10), ".", DEC1 (longitudeSec // 10), SecSym, " ",
········· "E" + (longitudeEW * 18)
··· 'for smsing the·information
··· SEROUT toModem,baud, [noparse][[/noparse]longitudeDeg+longitudeMin+(longitudeSec / 10)+(longitudeSec // 10)+(longitudeEW * 18)]
··· DEBUG CRSRXY, 14, 10, DEC2 timeHrs, ":", DEC2 timeMin, ":", DEC2 timeSec,
········· CRSRXY, 14, 11, DEC2 day, " "
········· eeAddress = (month - 1) * 4 + MonNames
··· GOSUB Print_Z_String
··· 'for smsing the·information
··· SEROUT toModem,baud, [noparse][[/noparse]timeHrs+timeMin+timeSec+day+(month - 1) * 4+MonNames]
··· RETURN



▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I need all ya guidance Masters. [noparse]:)[/noparse]

Comments

  • cabojoecabojoe Posts: 72
    edited 2004-09-09 08:10
    You are missing a RETURN at the end of your sub··retrieve_GPS I believe...therefore you never get to the second serial out. Doesn't look like you have posted the whole program, so it's kind of hard to tell where that sub ends.
  • ionion Posts: 101
    edited 2004-09-09 13:07
    Before the label retrieve_GPS1 you must put a return. It looks like your first sub finished there.

    ENDIF
    NEXT

    RETURN 'you need this at the end of a sub. to go back to the next line after subroutine call.


    retrieve_GPS1:
    SERIN GPSpin, BaudMode, 3000, retrieve_GPS, [noparse][[/noparse]WAIT("GPRMC,"), SPSTR 65]
    GOSUB Parse
  • ice-egozice-egoz Posts: 55
    edited 2004-09-13 02:05
    hi, over here, how long is this delay?
    SERIN thruModem,baud,Bad_Data,65000,checkNet, [noparse][[/noparse]WAIT("0,1"), STR serData\2]'the data is saved in serData as WORD
    65000? == 65seconds?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I need all ya guidance Masters. [noparse]:)[/noparse]
Sign In or Register to comment.