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)

API

gps_0.uart_port_id(1)
  • Set ID parameter
print(gps_0.altitude)
  • Get altitude
print(gps_0.course)
  • Get road information
print(gps_0.gps_date)
  • Get GPS data
print(gps_0.latitude)
  • Get latitude (string format: dddmm.mmmmm)
print(gps_0.latitude_decimal)
  • Get latitude (string format: dd.ddd)
print(gps_0.longitude_decimal)
  • Get longitude (string format: dddmm.mmmmm)
print(gps_0.longitude)
  • Get longitude (float format: dd.ddd)
print(gps_0.pos_quality)
  • Get positioning accuracy
print(gps_0.satellite_num)
  • Get number of satellites in view
print(gps_0.speed_knot)
  • Get ground speed
print(gps_0.gps_time)
  • Get local time
gps_0.set_time_zone(0)
  • Set local timezone
On This Page