Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
François Revol
firmware
Commits
6414bb35
Commit
6414bb35
authored
Jun 15, 2020
by
Rahix
Browse files
Options
Browse Files
Download
Plain Diff
Merge "Create weak link from `(u)module` to `module`"
See merge request
card10/firmware!388
parents
f0807c24
328b4fb8
Changes
22
Hide whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
168 additions
and
139 deletions
+168
-139
Documentation/pycardium/bhi160.rst
Documentation/pycardium/bhi160.rst
+3
-3
Documentation/pycardium/bme680.rst
Documentation/pycardium/bme680.rst
+2
-2
Documentation/pycardium/stdlib.rst
Documentation/pycardium/stdlib.rst
+12
-2
Documentation/pycardium/utime.rst
Documentation/pycardium/utime.rst
+9
-6
Documentation/pycardium/ws2812.rst
Documentation/pycardium/ws2812.rst
+2
-2
preload/apps/adventure_timer/__init__.py
preload/apps/adventure_timer/__init__.py
+12
-12
preload/apps/analog_clock/__init__.py
preload/apps/analog_clock/__init__.py
+12
-12
preload/apps/ble/__init__.py
preload/apps/ble/__init__.py
+2
-2
preload/apps/bme680_sensor_demo/__init__.py
preload/apps/bme680_sensor_demo/__init__.py
+2
-2
preload/apps/card10_nickname/__init__.py
preload/apps/card10_nickname/__init__.py
+15
-15
preload/apps/digiclk/__init__.py
preload/apps/digiclk/__init__.py
+9
-9
preload/apps/digiclk/monotime.py
preload/apps/digiclk/monotime.py
+19
-19
preload/apps/ecg/__init__.py
preload/apps/ecg/__init__.py
+8
-8
preload/apps/lsd_nickname/__init__.py
preload/apps/lsd_nickname/__init__.py
+2
-2
preload/apps/scope/__init__.py
preload/apps/scope/__init__.py
+2
-2
preload/apps/text_reader/__init__.py
preload/apps/text_reader/__init__.py
+2
-2
preload/menu.py
preload/menu.py
+7
-7
pycardium/modules/py/ledfx.py
pycardium/modules/py/ledfx.py
+5
-3
pycardium/modules/py/pov.py
pycardium/modules/py/pov.py
+23
-15
pycardium/modules/py/pride.py
pycardium/modules/py/pride.py
+2
-2
pycardium/modules/py/simple_menu.py
pycardium/modules/py/simple_menu.py
+12
-12
pycardium/mpconfigport.h
pycardium/mpconfigport.h
+6
-0
No files found.
Documentation/pycardium/bhi160.rst
View file @
6414bb35
...
...
@@ -28,18 +28,18 @@ The coordinate system of the BHI160 sensor data looks like this:
.. code-block:: python
import bhi160
import
u
time
import time
bhi = bhi160.BHI160Orientation()
while True:
samples = bhi.read()
if len(samples) == 0:
u
time.sleep(0.25)
time.sleep(0.25)
continue
# print the latest sample
print(samples[-1])
u
time.sleep(0.25)
time.sleep(0.25)
Orientation
...
...
Documentation/pycardium/bme680.rst
View file @
6414bb35
...
...
@@ -8,7 +8,7 @@ Allows access to environmental data of card10's surroundings.
.. code-block:: python
import bme680,
u
time
import bme680, time
with bme680.Bme680() as environment:
while True:
...
...
@@ -19,7 +19,7 @@ Allows access to environmental data of card10's surroundings.
print("Pressure: {:10.2f} hPa".format(d.pressure))
print("Gas Resistance: {:10.2f} Ω".format(d.resistance))
u
time.sleep(1)
time.sleep(1)
Sensor Class
------------
...
...
Documentation/pycardium/stdlib.rst
View file @
6414bb35
MicroPython Standard Library
============================
Pycardium contains some modules from the MicroPython standard library. These
are:
Pycardium contains some modules from the MicroPython standard library.
Some modules below use a standard Python name, but prefixed with “u”,
e.g. ujson instead of json. This is to signify that such a module is a
micro-library, i.e. implements only a subset of CPython module
functionality. Please refer to the official `MicroPython docs`_ for an
explanation why.
All u-name modules can also be imported using their non-u-name. E.g.
``import utime`` and import ``import time`` will both work.
.. _MicroPython docs: http://docs.micropython.org/en/latest/library/index.html#python-standard-libraries-and-micro-libraries
.. py:module:: framebuf
...
...
Documentation/pycardium/utime.rst
View file @
6414bb35
...
...
@@ -8,6 +8,9 @@ CPython but wouldn't fit anywhere else in our implementation. Most
prominently, this is the :py:func:`utime.alarm` function for setting an RTC
alarm.
Like all other u-name modules, ``utime`` can also imported using the standard
``import time`` statement.
.. |time| replace:: ``time``
.. _time: https://docs.python.org/3/library/time.html
...
...
@@ -135,13 +138,13 @@ alarm.
.. code-block:: python
import
u
time
import time
def minute_timer(x):
current =
u
time.time()
current = time.time()
print("Current: " + str(current))
alarm = (current // 60 + 1) * 60
u
time.alarm(alarm, minute_timer)
time.alarm(alarm, minute_timer)
minute_timer(None)
...
...
@@ -150,13 +153,13 @@ alarm.
.. code-block:: python
import interrupt,
u
time
import interrupt, time
def 5_second_timer(x):
current =
u
time.time()
current = time.time()
print("Current: " + str(current))
alarm = (current // 10) * 10 + 5
u
time.alarm(alarm)
time.alarm(alarm)
# This time, we need to register and enable the callback manually
interrupt.set_callback(interrupt.RTC_ALARM, 5_second_timer)
...
...
Documentation/pycardium/ws2812.rst
View file @
6414bb35
...
...
@@ -19,7 +19,7 @@ The ``ws2812`` module controls LEDs of the WS2812 type. Just as the ``leds`` mod
.. code-block:: python
import color,
u
time, ws2812, gpio
import color, time, ws2812, gpio
i = 0
while True:
...
...
@@ -28,6 +28,6 @@ The ``ws2812`` module controls LEDs of the WS2812 type. Just as the ``leds`` mod
col3 = color.from_hsv((i + 40) % 360, 1.0, 0.1)
ws2812.set_all(gpio.WRISTBAND_2, [col1, col2, col3])
i += 1
u
time.sleep_ms(10)
time.sleep_ms(10)
.. versionadded:: 1.10
preload/apps/adventure_timer/__init__.py
View file @
6414bb35
import
u
json
import
json
import
os
import
display
import
u
time
import
time
import
buttons
CONFIG_NAME
=
"at-timestamp.json"
...
...
@@ -11,7 +11,7 @@ def init():
if
CONFIG_NAME
not
in
os
.
listdir
(
"."
):
at_config
=
{
"time_start"
:
"unset"
}
f
=
open
(
CONFIG_NAME
,
"w"
)
f
.
write
(
u
json
.
dumps
(
at_config
))
f
.
write
(
json
.
dumps
(
at_config
))
f
.
close
()
if
is_timestamp_set
():
...
...
@@ -22,7 +22,7 @@ def init():
def
is_timestamp_set
():
f
=
open
(
CONFIG_NAME
,
"r"
)
c
=
u
json
.
loads
(
f
.
read
())
c
=
json
.
loads
(
f
.
read
())
f
.
close
()
if
c
[
"time_start"
]
==
"unset"
:
return
False
...
...
@@ -40,29 +40,29 @@ def triangle(disp, x, y, left):
def
timestamp_reset
():
f
=
open
(
CONFIG_NAME
,
"r"
)
c
=
u
json
.
loads
(
f
.
read
())
c
=
json
.
loads
(
f
.
read
())
c
[
"time_start"
]
=
"unset"
f
.
close
()
f
=
open
(
CONFIG_NAME
,
"w"
)
f
.
write
(
u
json
.
dumps
(
c
))
f
.
write
(
json
.
dumps
(
c
))
f
.
close
()
def
timestamp_read
():
global
time_start
f
=
open
(
CONFIG_NAME
,
"r"
)
c
=
u
json
.
loads
(
f
.
read
())
c
=
json
.
loads
(
f
.
read
())
time_start
=
c
[
"time_start"
]
f
.
close
()
def
timestamp_write
():
f
=
open
(
CONFIG_NAME
,
"r"
)
c
=
u
json
.
loads
(
f
.
read
())
c
[
"time_start"
]
=
u
time
.
time
()
c
=
json
.
loads
(
f
.
read
())
c
[
"time_start"
]
=
time
.
time
()
f
.
close
()
f
=
open
(
CONFIG_NAME
,
"w"
)
f
.
write
(
u
json
.
dumps
(
c
))
f
.
write
(
json
.
dumps
(
c
))
f
.
close
()
...
...
@@ -76,7 +76,7 @@ def menu():
triangle
(
disp
,
10
,
66
,
True
)
disp
.
print
(
"start."
,
posx
=
15
,
posy
=
60
,
fg
=
[
0
,
255
,
0
])
elif
menu_state
==
1
:
seconds
=
u
time
.
time
()
-
time_start
seconds
=
time
.
time
()
-
time_start
m
,
s
=
divmod
(
seconds
,
60
)
h
,
m
=
divmod
(
m
,
60
)
disp
.
print
(
"%02d:%02d:%02d"
%
(
h
,
m
,
s
),
posy
=
40
,
fg
=
[
255
,
255
,
255
])
...
...
@@ -122,4 +122,4 @@ while True:
menu_state
=
0
menu
()
disp
.
update
()
u
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
preload/apps/analog_clock/__init__.py
View file @
6414bb35
# Adapted from https://github.com/muccc/flipdots/blob/master/scripts/clock.py
import
display
from
u
time
import
sleep
import
u
time
from
time
import
sleep
import
time
import
math
import
leds
import
buttons
import
u
json
import
json
import
os
CONFIG_NAME
=
"clock.json"
...
...
@@ -100,7 +100,7 @@ class Clock:
def
readConfig
(
self
):
with
open
(
CONFIG_NAME
,
"r"
)
as
f
:
try
:
c
=
u
json
.
loads
(
f
.
read
())
c
=
json
.
loads
(
f
.
read
())
if
(
"themes"
in
c
and
len
(
c
[
"themes"
])
>
0
...
...
@@ -114,7 +114,7 @@ class Clock:
def
writeConfig
(
self
):
with
open
(
CONFIG_NAME
,
"w"
)
as
f
:
f
.
write
(
u
json
.
dumps
({
"theme"
:
self
.
theme
,
"themes"
:
self
.
themes
}))
f
.
write
(
json
.
dumps
({
"theme"
:
self
.
theme
,
"themes"
:
self
.
themes
}))
def
setTheme
(
self
,
theme
):
self
.
theme
=
theme
%
len
(
self
.
themes
)
...
...
@@ -159,7 +159,7 @@ class Clock:
try
:
with
display
.
open
()
as
disp
:
while
True
:
localtime
=
u
time
.
localtime
()
localtime
=
time
.
localtime
()
self
.
updateClock
(
disp
,
localtime
)
if
self
.
run_once
:
break
...
...
@@ -179,7 +179,7 @@ class Clock:
elif
button_pressed
and
v
&
buttons
.
TOP_RIGHT
!=
0
:
self
.
setTime
(
disp
,
localtime
)
u
time
.
sleep_ms
(
23
)
time
.
sleep_ms
(
23
)
except
KeyboardInterrupt
:
for
i
in
range
(
11
):
...
...
@@ -255,7 +255,7 @@ class Clock:
accepted
=
False
previously_pressed_button
=
buttons
.
TOP_RIGHT
button_repeat_counter
=
0
set_seconds
=
u
time
.
mktime
(
localtime
)
set_seconds
=
time
.
mktime
(
localtime
)
while
not
accepted
:
v
=
buttons
.
read
(
...
...
@@ -288,11 +288,11 @@ class Clock:
elif
previously_pressed_button
==
buttons
.
BOTTOM_RIGHT
:
set_seconds
+=
seconds_change
self
.
updateClock
(
disp
,
u
time
.
localtime
(
set_seconds
))
u
time
.
sleep_ms
(
23
)
self
.
updateClock
(
disp
,
time
.
localtime
(
set_seconds
))
time
.
sleep_ms
(
23
)
u
time
.
set_time
(
int
(
set_seconds
))
u
time
.
sleep_ms
(
123
)
time
.
set_time
(
int
(
set_seconds
))
time
.
sleep_ms
(
123
)
def
circlePoint
(
self
,
t
):
return
(
...
...
preload/apps/ble/__init__.py
View file @
6414bb35
import
os
import
display
import
u
time
import
time
import
buttons
CONFIG_NAME
=
"ble.txt"
...
...
@@ -84,4 +84,4 @@ while True:
selector
()
disp
.
update
()
u
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
preload/apps/bme680_sensor_demo/__init__.py
View file @
6414bb35
...
...
@@ -7,7 +7,7 @@ import buttons
import
color
import
display
import
os
import
u
time
import
time
import
bme680
...
...
@@ -25,7 +25,7 @@ def main():
disp
.
print
(
"{:7.2f} rh"
.
format
(
sensor_data
[
1
]),
posy
=
40
)
disp
.
print
(
"{:7.2f} hPa"
.
format
(
sensor_data
[
2
]),
posy
=
60
)
disp
.
update
()
u
time
.
sleep
(
10
)
time
.
sleep
(
10
)
if
__name__
==
"__main__"
:
...
...
preload/apps/card10_nickname/__init__.py
View file @
6414bb35
import
u
time
import
time
import
display
import
leds
import
ledfx
import
buttons
import
light_sensor
import
u
json
import
json
import
os
FILENAME
=
"nickname.txt"
...
...
@@ -54,9 +54,9 @@ def blink_led(led):
:param led: led to blink
"""
leds
.
clear
()
u
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
leds
.
set
(
led
,
[
255
,
0
,
0
])
u
time
.
sleep
(
0.1
)
time
.
sleep
(
0.1
)
leds
.
clear
()
...
...
@@ -118,15 +118,15 @@ def get_time():
:return: timestamp
"""
timestamp
=
""
if
u
time
.
localtime
()[
3
]
<
10
:
if
time
.
localtime
()[
3
]
<
10
:
timestamp
=
timestamp
+
"0"
timestamp
=
timestamp
+
str
(
u
time
.
localtime
()[
3
])
+
":"
if
u
time
.
localtime
()[
4
]
<
10
:
timestamp
=
timestamp
+
str
(
time
.
localtime
()[
3
])
+
":"
if
time
.
localtime
()[
4
]
<
10
:
timestamp
=
timestamp
+
"0"
timestamp
=
timestamp
+
str
(
u
time
.
localtime
()[
4
])
+
":"
if
u
time
.
localtime
()[
5
]
<
10
:
timestamp
=
timestamp
+
str
(
time
.
localtime
()[
4
])
+
":"
if
time
.
localtime
()[
5
]
<
10
:
timestamp
=
timestamp
+
"0"
timestamp
=
timestamp
+
str
(
u
time
.
localtime
()[
5
])
timestamp
=
timestamp
+
str
(
time
.
localtime
()[
5
])
return
timestamp
...
...
@@ -166,7 +166,7 @@ def render_nickname(title, sub, fg, bg, fg_sub, bg_sub, main_bg, mode, bat):
b
=
0
rainbow_led_pos
=
0
r_sub
=
sub
last_btn_poll
=
u
time
.
time
()
-
2
last_btn_poll
=
time
.
time
()
-
2
while
True
:
sleep
=
0.5
if
sub
==
"#time"
:
...
...
@@ -181,8 +181,8 @@ def render_nickname(title, sub, fg, bg, fg_sub, bg_sub, main_bg, mode, bat):
r_bg
=
main_bg
[
dark
]
# Button handling
pressed
=
buttons
.
read
(
buttons
.
BOTTOM_LEFT
|
buttons
.
BOTTOM_RIGHT
)
if
u
time
.
time
()
-
last_btn_poll
>=
1
:
last_btn_poll
=
u
time
.
time
()
if
time
.
time
()
-
last_btn_poll
>=
1
:
last_btn_poll
=
time
.
time
()
if
pressed
&
buttons
.
BOTTOM_RIGHT
!=
0
:
anim
=
anim
+
1
if
anim
>=
len
(
ANIM_TYPES
):
...
...
@@ -267,7 +267,7 @@ def render_nickname(title, sub, fg, bg, fg_sub, bg_sub, main_bg, mode, bat):
)
disp
.
update
()
disp
.
close
()
u
time
.
sleep
(
sleep
)
time
.
sleep
(
sleep
)
def
get_key
(
json
,
key
,
default
):
...
...
@@ -291,7 +291,7 @@ with display.open() as disp:
if
FILENAME_ADV
in
os
.
listdir
(
"."
):
f
=
open
(
FILENAME_ADV
,
"r"
)
try
:
c
=
u
json
.
loads
(
f
.
read
())
c
=
json
.
loads
(
f
.
read
())
f
.
close
()
# parse config
nick
=
get_key
(
c
,
"nickname"
,
"no nick"
)
...
...
preload/apps/digiclk/__init__.py
View file @
6414bb35
...
...
@@ -5,7 +5,7 @@ import display
import
buttons
sys
.
path
.
append
(
"/apps/digiclk/"
)
import
monotime
as
u
time
import
monotime
as
time
import
draw
DIGITS
=
[
...
...
@@ -48,7 +48,7 @@ def renderBar(d, num):
def
render
(
d
):
ltime
=
u
time
.
localtime
()
ltime
=
time
.
localtime
()
years
=
ltime
[
0
]
months
=
ltime
[
1
]
days
=
ltime
[
2
]
...
...
@@ -111,7 +111,7 @@ def checkButton(button, button_long, osbutton, pressed, t):
def
checkButtons
():
global
pressed_prev
t
=
u
time
.
time_monotonic_ms
()
t
=
time
.
time_monotonic_ms
()
pressed
=
buttons
.
read
(
buttons
.
BOTTOM_LEFT
|
buttons
.
TOP_RIGHT
|
buttons
.
BOTTOM_RIGHT
)
...
...
@@ -130,8 +130,8 @@ def checkButtons():
def
modTime
(
yrs
,
mth
,
day
,
hrs
,
mns
,
sec
):
ltime
=
u
time
.
localtime
()
new
=
u
time
.
mktime
(
ltime
=
time
.
localtime
()
new
=
time
.
mktime
(
(
ltime
[
0
]
+
yrs
,
ltime
[
1
]
+
mth
,
...
...
@@ -143,7 +143,7 @@ def modTime(yrs, mth, day, hrs, mns, sec):
None
,
)
)
u
time
.
set_time
(
new
)
time
.
set_time
(
new
)
def
ctrl_display
(
bs
):
...
...
@@ -334,13 +334,13 @@ def main():
bs
=
checkButtons
()
CTRL_FNS
[
MODE
](
bs
)
last_secs
,
secs
=
secs
,
u
time
.
time_monotonic
()
last_secs
,
secs
=
secs
,
time
.
time_monotonic
()
if
updated
or
secs
>
last_secs
:
render
(
d
)
last_msecs
,
msecs
=
msecs
,
u
time
.
time_monotonic_ms
()
last_msecs
,
msecs
=
msecs
,
time
.
time_monotonic_ms
()
if
msecs
-
last_msecs
<
BUTTON_UPDATE_TIME
:
u
time
.
sleep_ms
(
BUTTON_UPDATE_TIME
-
(
msecs
-
last_msecs
))
time
.
sleep_ms
(
BUTTON_UPDATE_TIME
-
(
msecs
-
last_msecs
))
except
KeyboardInterrupt
:
pass
...
...
preload/apps/digiclk/monotime.py
View file @
6414bb35
import
u
time
as
_utime
import
time
as
_utime
_offset_ms
=
0
def
time_monotonic
():
return
_
u
time
.
time
()
+
_offset_ms
//
1000
return
_time
.
time
()
+
_offset_ms
//
1000
def
time_monotonic_ms
():
return
_
u
time
.
time_ms
()
+
_offset_ms
return
_time
.
time_ms
()
+
_offset_ms
def
sleep
(
s
):
return
_
u
time
.
sleep
(
s
)
return
_time
.
sleep
(
s
)
def
sleep_ms
(
ms
):
return
_
u
time
.
sleep_ms
(
ms
)
return
_time
.
sleep_ms
(
ms
)
def
sleep_us
(
us
):
return
_
u
time
.
sleep_us
(
us
)
return
_time
.
sleep_us
(
us
)
def
time
():
return
_
u
time
.
time
()
return
_time
.
time
()
def
time_ms
():
return
_
u
time
.
time_ms
()
return
_time
.
time_ms
()
def
set_time
(
t
):
global
_offset_ms
cur_t
=
_
u
time
.
time_ms
()
_
u
time
.
set_time
(
t
)
new_t
=
_
u
time
.
time_ms
()
cur_t
=
_time
.
time_ms
()
_time
.
set_time
(
t
)
new_t
=
_time
.
time_ms
()
diff
=
cur_t
-
new_t
_offset_ms
+=
diff
...
...
@@ -45,9 +45,9 @@ def set_time(t):
def
set_unix_time
(
t
):
global
_offset_ms
cur_t
=
_
u
time
.
time_ms
()
_
u
time
.
set_unix_time
(
t
)
new_t
=
_
u
time
.
time_ms
()
cur_t
=
_time
.
time_ms
()
_time
.
set_unix_time
(
t
)
new_t
=
_time
.
time_ms
()
diff
=
cur_t
-
new_t
_offset_ms
+=
diff
...
...
@@ -55,17 +55,17 @@ def set_unix_time(t):
def
localtime
(
s
=
None
):
if
s
!=
None
:
return
_
u
time
.
localtime
(
s
)
return
_time
.
localtime
(
s
)
else
:
return
_
u
time
.
localtime
()
return
_time
.
localtime
()
def
mktime
(
t
):
return
_
u
time
.
mktime
(
t
)
return
_time
.
mktime
(
t
)
def
alarm
(
s
,
cb
=
None
):
if
cb
!=
None
:
return
_
u
time
.
alarm
(
s
,
cb
)
return
_time
.
alarm
(
s
,
cb
)
else
:
return
_
u
time
.
alarm
(
s
)
return
_time
.
alarm
(
s
)
preload/apps/ecg/__init__.py
View file @
6414bb35
import
os
import
display
import
leds
import
u
time
import
time
import
buttons
import
max30001
import
math
...
...
@@ -178,7 +178,7 @@ def append_to_file(fileprefix, content):
def
write_pulse
():
# estimates timestamp as calls to
u
time.time() take too much time
# estimates timestamp as calls to time.time() take too much time
approx_timestamp
=
write
+
samples_since_start_of_write
//
config
.
get_option
(
"Rate"
)
append_to_file
(
"pulse"
,
struct
.
pack
(
"ib"
,
approx_timestamp
,
pulse
))
...
...
@@ -206,7 +206,7 @@ def close_sensor():
def
toggle_write
():
global
write
,
disp
,
pause_screen
,
filebuffer
,
samples_since_start_of_write
,
write_time_string
pause_screen
=
u
time
.
time_ms
()
+
1000
pause_screen
=
time
.
time_ms
()
+
1000
disp
.
clear
(
COLOR_BACKGROUND
)
if
write
>
0
:
write_filebuffer
()
...
...
@@ -215,8 +215,8 @@ def toggle_write():
disp
.
print
(
"logging"
,
posx
=
30
,
posy
=
40
,
fg
=
COLOR_TEXT
)
else
:
filebuffer
=
bytearray
()
write
=
u
time
.
time
()
lt
=
u
time
.
localtime
(
write
)
write
=
time
.
time
()
lt
=
time
.
localtime
(
write
)
write_time_string
=
"{:04d}-{:02d}-{:02d}_{:02d}{:02d}{:02d}"
.
format
(
*
lt
)
samples_since_start_of_write
=
0
try
:
...
...
@@ -285,7 +285,7 @@ def draw_graph():
if
pause_screen
==
-
1
:
return
elif
pause_screen
>
0
:
t
=
u
time
.
time_ms
()
t
=
time
.
time_ms
()
if
t
>
pause_screen
:
pause_screen
=
0
else
:
...
...
@@ -356,7 +356,7 @@ def draw_graph():
# announce writing ecg log
if
write
>
0
:
t
=
u
time
.
time
()
t
=
time
.
time
()
if
write
>
0
and
t
%
2
==
0
:
disp
.
print
(
"LOG"
,
posx
=
0
,
posy
=
60
,
fg
=
COLOR_WRITE_FG
,
bg
=
COLOR_WRITE_BG
)
...
...
@@ -381,7 +381,7 @@ def main():
"< WriteLog "
,
posx
=
0
,
posy
=
64
,
fg
=
COLOR_WRITE_BG
,
font
=
display
.
FONT16
)
disp
.
update
()
u
time
.
sleep
(
3
)
time
.
sleep
(
3
)
# start ecg
open_sensor
()
...
...
preload/apps/lsd_nickname/__init__.py
View file @
6414bb35
import
display
import
leds
import
u
time
import
time
_rand
=
123456789
...
...
@@ -43,4 +43,4 @@ while True:
d
.
close
()
leds
.
set
(
rand
()
%
11
,
colors
[
rand
()
%
len
(
colors
)])
leds
.
set_rocket
(
rand
()
%
3
,
rand
()
%
32
)
u
time
.
sleep_us
(
1
)
# Feed watch doge
time
.
sleep_us
(
1
)
# Feed watch doge
preload/apps/scope/__init__.py
View file @
6414bb35
import
os
import
display
import
u
time
import
time