diff options
Diffstat (limited to 'gpstest.py')
| -rw-r--r-- | gpstest.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gpstest.py b/gpstest.py new file mode 100644 index 0000000..88c5198 --- /dev/null +++ b/gpstest.py @@ -0,0 +1,14 @@ +import sys,gps
+port = 6
+gps = GPSDevice(port)
+gps.open()
+for record in gps.read_all():
+ if sys.argv[0] == 'forever':
+ print record
+ else:
+ if record['sentence'] == 'GLL':
+ print 'I am hanging out at long %s, lat %s at %s' % (
+ record['longitude'],
+ record['latitude'],
+ record['time'])
+ break
\ No newline at end of file |
