Skip to content

Commit a4f0525

Browse files
committed
Modified version of simpletest to allow me to test different formats
1 parent 213c36b commit a4f0525

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tester.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Simple GPS module demonstration.
2+
# Will wait for a fix and print a message every second with the current location
3+
# and other details.
4+
import time
5+
import board
6+
import busio
7+
8+
import adafruit_gps
9+
10+
11+
RX = board.RX
12+
TX = board.TX
13+
14+
uart = busio.UART(TX, RX, baudrate=9600, timeout=30)
15+
16+
gps = adafruit_gps.GPS(uart, debug=False)
17+
18+
gps.send_command(b'PMTK314,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0')
19+
# Turn on just minimum info (RMC only, location):
20+
#gps.send_command(b'PMTK314,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0')
21+
# Turn off everything:
22+
#gps.send_command(b'PMTK314,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0')
23+
# Tuen on everything (not all of it is parsed!)
24+
#gps.send_command(b'PMTK314,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0')
25+
26+
gps.send_command(b'PMTK220,1000')
27+
28+
last_print = time.monotonic()
29+
while True:
30+
a = gps.update()
31+
current = time.monotonic()
32+
if current - last_print >= 1.0:
33+
last_print = current
34+
print(a)

0 commit comments

Comments
 (0)