Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
F
firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
card10
firmware
Commits
14606dab
Commit
14606dab
authored
4 years ago
by
schneider
Browse files
Options
Downloads
Patches
Plain Diff
chore(g-watch): use time instead of utime
parent
2f671ced
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!396
Add G-Watch to preload
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
preload/apps/g_watch/__init__.py
+8
-8
8 additions, 8 deletions
preload/apps/g_watch/__init__.py
with
8 additions
and
8 deletions
preload/apps/g_watch/__init__.py
+
8
−
8
View file @
14606dab
...
...
@@ -4,7 +4,7 @@ import ledfx
import
leds
import
math
import
bhi160
import
u
time
import
time
import
power
import
light_sensor
...
...
@@ -126,7 +126,7 @@ def render_colon():
def
render7segment
():
year
,
month
,
mday
,
hour
,
min
,
sec
,
wday
,
yday
=
u
time
.
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
=
u
time
.
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
=
u
time
.
monotonic_ms
()
lt
=
u
time
.
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
)
u
time
.
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
)
u
time
.
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
=
u
time
.
localtime
()
lt
=
time
.
localtime
()
year
=
lt
[
0
]
month
=
lt
[
1
]
day
=
lt
[
2
]
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment