I am getting from serial port 2 , GPS string
continously. I am willing to catch only the strings which starts
‘$TGPS,’ and finish ‘*’char by separator ‘,’, end put each field into
variable.
I need example code
Thanks
Haim Rodrik
Python has a string split function which makes an easy job to split first by NMEA terminator <CR><LF> then by , .
Thank you for reply,
Its my first script using Python in my life. I used Java G24 before and assembly. I dont have so much examples for split function
I can use the string end charactrs , the gps module that i am using its customized string.
Thanks
I do this things as shown below:
#Module: GE864-GPS, Internal using of GPS
import GPS
x = GPS.getActualPosition()
#Get GPS data from internal Python module
GPS_list = x.split(‘,’)
#Split GPS data into list (throw the separators: ‘,’ )
#Now, for example, parse some NMEA elements into variables:
We use cookies to enhance your browsing experience and help us improve our websites. To improve our website, we carefully select third parties that use cookies to allow us to serve specific content and achieve the purposes set out in our cookie policy. For more information on how to make adjustments through your browser to the cookies being used on your device, please click Find Out More link. By closing this banner or continuing to browse our website, you agree to our use of such cookies. FIND OUT MORE
Hi,
I am getting from serial port 2 , GPS string
continously. I am willing to catch only the strings which starts
‘$TGPS,’ and finish ‘*’char by separator ‘,’, end put each field into
variable.
I need example code
Thanks
Haim Rodrik
Python has a string split function which makes an easy job to split first by NMEA terminator <CR><LF> then by , .
Thank you for reply,
Its my first script using Python in my life. I used Java G24 before and assembly. I dont have so much examples for split function
I can use the string end charactrs , the gps module that i am using its customized string.
Thanks