Using GPS Class in Python for getting location information

We have developed a gps_class library in Python for reliably get GPS updates, which includes CRC checking for any data mismatch. GPS data can be obtained from any NMEA based GPS module with no more than 2 lines of code..!!!

python

 

 

Below is the link for the source code for the GPS Class.

https://github.com/elementzonline/RaspberryPi-Sample-Codes/tree/master/GPS_class

The usage of GPS Class is as follows.

__author__ = 'Elementz_Engineers_Guild_Pvt_Ltd'

import serial
from gps_class import gps


serGPS = serial.Serial(port='/dev/ttyUSB0', baudrate=9600, bytesize=serial.EIGHTBITS,
                    parity=serial.PARITY_NONE,
                    stopbits=serial.STOPBITS_ONE, timeout=None,
                    xonxoff=False, rtscts=False,
                    writeTimeout=None, dsrdtr=False,
                    interCharTimeout=None)

gps_ser = gps(serGPS)
while(True):
    print gps_ser.readGPS()  // returns lattitude, longitude, date and time
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s