a GOSUB in between 2 SEROUTs?
ice-egoz
Posts: 55
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]
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
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
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]