Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
flow3r firmware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
5e045aef
Commit
5e045aef
authored
May 19, 2023
by
dx
Browse files
Options
Downloads
Patches
Plain Diff
python: list of MODULES for menu
parent
28ee6eac
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/main.py
+20
-15
20 additions, 15 deletions
python_payload/main.py
with
20 additions
and
15 deletions
python_payload/main.py
+
20
−
15
View file @
5e045aef
...
@@ -4,6 +4,11 @@ import time
...
@@ -4,6 +4,11 @@ import time
import
cap_touch_demo
import
cap_touch_demo
import
melodic_demo
import
melodic_demo
MODULES
=
[
cap_touch_demo
,
melodic_demo
,
]
boot
=
Pin
(
0
,
Pin
.
IN
)
boot
=
Pin
(
0
,
Pin
.
IN
)
vol_up
=
Pin
(
35
,
Pin
.
IN
,
Pin
.
PULL_UP
)
vol_up
=
Pin
(
35
,
Pin
.
IN
,
Pin
.
PULL_UP
)
vol_down
=
Pin
(
37
,
Pin
.
IN
,
Pin
.
PULL_UP
)
vol_down
=
Pin
(
37
,
Pin
.
IN
,
Pin
.
PULL_UP
)
...
@@ -86,24 +91,23 @@ def run_menu():
...
@@ -86,24 +91,23 @@ def run_menu():
draw_volume_slider
()
draw_volume_slider
()
display_update
()
display_update
()
if
long_bottom_petal_captouch_blocking
(
0
,
20
):
selected_petal
=
None
clear_all_leds
()
selected_module
=
None
highlight_bottom_petal
(
0
,
55
,
0
,
0
)
for
petal
,
module
in
enumerate
(
MODULES
):
display_fill
(
background
)
if
long_bottom_petal_captouch_blocking
(
petal
,
20
):
display_update
()
selected_petal
=
petal
foreground
=
cap_touch_demo
.
run
selected_module
=
module
time
.
sleep_ms
(
100
)
break
clear_all_leds
()
cap_touch_demo
.
foreground
()
if
selected_petal
is
not
None
:
if
long_bottom_petal_captouch_blocking
(
1
,
20
):
clear_all_leds
()
clear_all_leds
()
highlight_bottom_petal
(
1
,
55
,
0
,
0
)
highlight_bottom_petal
(
selected_petal
,
55
,
0
,
0
)
display_fill
(
background
)
display_fill
(
background
)
display_update
()
display_update
()
foreground
=
m
el
odic_demo
.
run
foreground
=
s
el
ected_module
.
run
time
.
sleep_ms
(
100
)
time
.
sleep_ms
(
100
)
clear_all_leds
()
clear_all_leds
()
m
el
odic_demo
.
foreground
()
s
el
ected_module
.
foreground
()
def
foreground_menu
():
def
foreground_menu
():
clear_all_leds
()
clear_all_leds
()
...
@@ -131,8 +135,9 @@ def main():
...
@@ -131,8 +135,9 @@ def main():
global
foreground
global
foreground
time
.
sleep_ms
(
5000
)
time
.
sleep_ms
(
5000
)
captouch_autocalib
()
captouch_autocalib
()
cap_touch_demo
.
init
()
melodic_demo
.
init
()
for
module
in
MODULES
:
module
.
init
()
foreground
=
run_menu
foreground
=
run_menu
foreground_menu
()
foreground_menu
()
...
...
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