diff --git a/preload/apps/g_watch/__init__.py b/preload/apps/g_watch/__init__.py index 9a42d4cc94b23aa297c57e9a66ebe86d08c343f3..bef8807e7ef02c910cbf69d6d8bfa292529ecebd 100644 --- a/preload/apps/g_watch/__init__.py +++ b/preload/apps/g_watch/__init__.py @@ -4,7 +4,7 @@ import ledfx import leds import math import bhi160 -import utime +import time import power import light_sensor @@ -126,7 +126,7 @@ def render_colon(): def render7segment(): - year, month, mday, hour, min, sec, wday, yday = utime.localtime() + year, month, mday, hour, min, sec, wday, yday = time.localtime() render_num(hour, 1) render_num(min, 13) @@ -146,7 +146,7 @@ with display.open() as disp: yn = 0 # new y value yd = 0 # y difference ydl = 0 # yd lpf - clock_on = utime.monotonic_ms() # time in ms when clock is turned on + clock_on = time.monotonic_ms() # time in ms when clock is turned on timeout = 7000 # time in ms how long clock will be displayed clock_off = clock_on + timeout # time in ms when clock is turned off fade_time = 0 # fade out counter @@ -156,8 +156,8 @@ with display.open() as disp: p_leds_on = 0 while True: - millis = utime.monotonic_ms() - lt = utime.localtime() + millis = time.monotonic_ms() + lt = time.localtime() dow = lt[6] # ---------------------------------------- read brightness sensor @@ -183,7 +183,7 @@ with display.open() as disp: disp.print("LEDS OFF", posx=40, posy=30, font=2) disp.update() disp.backlight(brightness=50) - utime.sleep_ms(500) + time.sleep_ms(500) disp.backlight(brightness=0) for led in range(led_count): leds.prep_hsv(led, [0, 0, 0]) @@ -195,7 +195,7 @@ with display.open() as disp: disp.print("LEDS ON", posx=40, posy=30, font=2) disp.update() disp.backlight(brightness=50) - utime.sleep_ms(500) + time.sleep_ms(500) disp.backlight(brightness=0) # ---------------------------------------- read orientation sensor @@ -241,7 +241,7 @@ with display.open() as disp: if clock_off >= millis: # .................................... time - lt = utime.localtime() + lt = time.localtime() year = lt[0] month = lt[1] day = lt[2]