toc Pytrack Examples Tutorials & Examples > Shields >

Pytrack Examples

Both the Pysense and Pytrack use the same accelerometer. Please see the Pysense Examples to see how to use the accelerometer.

Note: You can find this example in the GitHub repository. Over there, you can also find the relevant libraries.

GPS Example

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
from pytrack import Pytrack


# setup rtc
rtc = machine.RTC()
print('\nRTC Set from NTP to UTC:',
print('Adjusted from UTC to EST timezone', utime.localtime(), '\n')

py = Pytrack()
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,
    print("{} - {} - {}".format(coord,, gc.mem_free()))

Alternative Libraries