-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ab6d6e
commit cbc8ab1
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |