pdf-icon

UIFlow Guide

UIFlow 1.0 Blockly

Event

Unit

UIFlow 1.0 Project

Unit GPS

Example

Get local time, latitude and longitude information

from m5stack import *
from m5ui import *
from uiflow import *
import unit

setScreenColor(0x222222)
gps_0 = unit.get(unit.GPS, unit.PORTC)

while True:
  print(gps_0.gps_time)
  print(gps_0.latitude)
  print(gps_0.longitude)
  print(gps_0.pos_quality)
  wait_ms(2)
Copy

API

gps_0.uart_port_id(1)
Copy
  • Set ID parameter
print(gps_0.altitude)
Copy
  • Get altitude
print(gps_0.course)
Copy
  • Get road information
print(gps_0.gps_date)
Copy
  • Get GPS data
print(gps_0.latitude)
Copy
  • Get latitude (string format: dddmm.mmmmm)
print(gps_0.latitude_decimal)
Copy
  • Get latitude (string format: dd.ddd)
print(gps_0.longitude_decimal)
Copy
  • Get longitude (string format: dddmm.mmmmm)
print(gps_0.longitude)
Copy
  • Get longitude (float format: dd.ddd)
print(gps_0.pos_quality)
Copy
  • Get positioning accuracy
print(gps_0.satellite_num)
Copy
  • Get number of satellites in view
print(gps_0.speed_knot)
Copy
  • Get ground speed
print(gps_0.gps_time)
Copy
  • Get local time
gps_0.set_time_zone(0)
Copy
  • Set local timezone
On This Page
Example
API
Q&A
Submit a question
Select question category*
Arduino
MicroPython
UIFlow1
UIFlow2
EzData
M5Burner
Software
Hardware
Other
Product name
Product version
Question description*
(Supports pasting screenshots.)
Attachments
Add Files
Email*
Submit
OK