forked from StefanSimis/PyTrios
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgpstest.py
More file actions
39 lines (27 loc) · 701 Bytes
/
gpstest.py
File metadata and controls
39 lines (27 loc) · 701 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/python
# -*- coding: utf-8 -*-
"""
What documentation!
Created on Fri Jan 15 10:41:10 2016
user running this needs to be part of 'dialout' group, try:
sudo gpasswd --add ${USER} dialout
"""
__author__ = 'stsi'
import os
import numpy as np
import sys
from pytrios import gpslib
import serial
import time
ser = serial.Serial('COM7', baudrate=4800) # open serial port
if not ser.isOpen:
ser.open()
if not ser.isOpen:
print("Could not open GPS serial port")
# sys.exit(1)
gps = gpslib.GPSManager()
gps.add_serial_port(ser)
gps.start()
for i in range(10):
print gps.fix_type, gps.fix_quality, gps.old, gps.datetime, gps.lat, gps.lon, gps.speed
time.sleep(1)