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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dos
flow3r firmware
Commits
3b4145fc
Commit
3b4145fc
authored
1 year ago
by
dx
Committed by
q3k
1 year ago
Browse files
Options
Downloads
Patches
Plain Diff
uppercase some more vars
parent
1aaefb2e
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
python_payload/main.py
+15
-15
15 additions, 15 deletions
python_payload/main.py
with
15 additions
and
15 deletions
python_payload/main.py
+
15
−
15
View file @
3b4145fc
...
...
@@ -26,10 +26,10 @@ SELECT_TEXT = [
"
## #### #### #### ## # #
"
,
]
background
=
0
g
=
0b0000011111100000
r
=
0b1111100000000000
b
=
0b0000000000011111
BACKGROUND_COLOR
=
0
GREEN
=
0b0000011111100000
RED
=
0b1111100000000000
BLUE
=
0b0000000000011111
# pin numbers
# right side: left 37, down 0, right 35
...
...
@@ -48,15 +48,15 @@ def draw_text_big(text, x, y):
for
l
,
line
in
enumerate
(
text
):
for
p
,
pixel
in
enumerate
(
line
):
if
(
pixel
==
'
#
'
):
display_draw_pixel
(
xpos
-
2
*
p
,
ypos
-
2
*
l
,
r
)
display_draw_pixel
(
xpos
-
2
*
p
,
ypos
-
2
*
l
-
1
,
b
)
display_draw_pixel
(
xpos
-
2
*
p
-
1
,
ypos
-
2
*
l
,
b
)
display_draw_pixel
(
xpos
-
2
*
p
-
1
,
ypos
-
2
*
l
-
1
,
r
)
display_draw_pixel
(
xpos
-
2
*
p
,
ypos
-
2
*
l
,
RED
)
display_draw_pixel
(
xpos
-
2
*
p
,
ypos
-
2
*
l
-
1
,
BLUE
)
display_draw_pixel
(
xpos
-
2
*
p
-
1
,
ypos
-
2
*
l
,
BLUE
)
display_draw_pixel
(
xpos
-
2
*
p
-
1
,
ypos
-
2
*
l
-
1
,
RED
)
def
highlight_bottom_petal
(
num
,
r
,
g
,
b
):
def
highlight_bottom_petal
(
num
,
RED
,
GREEN
,
BLUE
):
start
=
4
+
8
*
num
for
i
in
range
(
7
):
set_led_rgb
(((
i
+
start
)
%
40
),
r
,
g
,
b
)
set_led_rgb
(((
i
+
start
)
%
40
),
RED
,
GREEN
,
BLUE
)
update_leds
()
def
long_bottom_petal_captouch_blocking
(
num
,
ms
):
...
...
@@ -79,14 +79,14 @@ def draw_volume_slider():
if
length
<
0
:
length
=
0
length
=
int
(
length
)
draw_rect
(
70
,
20
,
100
,
10
,
g
)
draw_rect
(
70
,
20
,
100
,
10
,
GREEN
)
draw_rect
(
71
,
21
,
98
,
8
,
0
)
draw_rect
(
72
+
96
-
length
,
22
,
length
,
6
,
g
)
draw_rect
(
72
+
96
-
length
,
22
,
length
,
6
,
GREEN
)
def
run_menu
():
global
foreground
display_fill
(
background
)
display_fill
(
BACKGROUND_COLOR
)
draw_text_big
(
SELECT_TEXT
,
0
,
0
)
draw_volume_slider
()
display_update
()
...
...
@@ -102,7 +102,7 @@ def run_menu():
if
selected_petal
is
not
None
:
clear_all_leds
()
highlight_bottom_petal
(
selected_petal
,
55
,
0
,
0
)
display_fill
(
background
)
display_fill
(
BACKGROUND_COLOR
)
display_update
()
foreground
=
selected_module
.
run
time
.
sleep_ms
(
100
)
...
...
@@ -113,7 +113,7 @@ def foreground_menu():
clear_all_leds
()
highlight_bottom_petal
(
0
,
0
,
55
,
55
);
highlight_bottom_petal
(
1
,
55
,
0
,
55
);
display_fill
(
background
)
display_fill
(
BACKGROUND_COLOR
)
draw_text_big
(
SELECT_TEXT
,
0
,
0
)
display_update
()
...
...
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