Skip to content

Commit

Permalink
basic gps template used
Browse files Browse the repository at this point in the history
  • Loading branch information
tomas-fryza committed Nov 14, 2024
1 parent 2ab6d6e commit cbc8ab1
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions examples/11-gps/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Rui Santos & Sara Santos - Random Nerd Tutorials
# Complete project details at https://RandomNerdTutorials.com/micropython-esp32-neo-6m-gps/

import machine
from time import sleep

# Define the UART pins and create a UART object
gps_serial = machine.UART(2, baudrate=9600, tx=17, rx=16)

while True:
if gps_serial.any():
line = gps_serial.readline() # Read a complete line from the UART
if line:
line = line.decode('utf-8')
print(line.strip())
sleep(0.5)

0 comments on commit cbc8ab1

Please sign in to comment.