Skip to content

Commit 2a9e7ab

Browse files
authored
Update SimpleWebClockWithTimer.py
1 parent ec48691 commit 2a9e7ab

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

SimpleWebClockWithTimer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
SCL = 5
77
SDA = 4
88

9-
import network, ntptime, utime, ssd1306, gc
9+
import network, ntptime, time, ssd1306, gc
1010
from machine import Pin, SoftI2C, Timer
1111

1212
gc.enable()
@@ -33,12 +33,12 @@ def ntpUpdate(timer):
3333
ntptime.settime() # query NTP server and update system time
3434
break
3535
except:
36-
utime.sleep(5) # try again if failed
36+
time.sleep(5) # try again if failed
3737

3838
# display update function
3939
def clockUpdate(timer):
4040
global sec_prev
41-
lt = utime.localtime(utime.time() + TMZ_HOUR_OFFSET * 3600)
41+
lt = time.localtime(time.time() + TMZ_HOUR_OFFSET * 3600)
4242
if lt[5] != sec_prev:
4343
display.fill(0)
4444
display.text(weekday[lt[6]], 8, 8)

0 commit comments

Comments
 (0)