-
Notifications
You must be signed in to change notification settings - Fork 0
/
gps.py
34 lines (28 loc) · 733 Bytes
/
gps.py
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
import machine
import math
import network
import os
import time
import utime
import gc
from machine import RTC
from machine import SD
from L76GNSS import L76GNSS
time.sleep(2)
gc.enable()
# setup rtc
rtc = machine.RTC()
rtc.ntp_sync("pool.ntp.org")
utime.sleep_ms(750)
print('\nRTC Set from NTP to UTC:', rtc.now())
utime.timezone(3600)
print('Adjusted from UTC to EST timezone', utime.localtime(), '\n')
py = os.fsformat('/flash')
l76 = L76GNSS(py, timeout=30)
# sd = SD()
# os.mount(sd, '/sd')
# f = open('/sd/gps-record.txt', 'w')
while (True):
coord = l76.coordinates()
#f.write("{} - {}\n".format(coord, rtc.now()))
print("{} - {} - {}".format(coord, rtc.now(), gc.mem_free()))