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
d3ac662c
Commit
d3ac662c
authored
1 year ago
by
moon2
Browse files
Options
Downloads
Patches
Plain Diff
captouch demo: fixed OS integration issues
note to self don't just test with mpremote run :3
parent
202895e3
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
python_payload/apps/demo_cap_touch/__init__.py
+9
-2
9 additions, 2 deletions
python_payload/apps/demo_cap_touch/__init__.py
python_payload/apps/demo_cap_touch/flow3r.toml
+1
-1
1 addition, 1 deletion
python_payload/apps/demo_cap_touch/flow3r.toml
with
10 additions
and
3 deletions
python_payload/apps/demo_cap_touch/__init__.py
+
9
−
2
View file @
d3ac662c
...
...
@@ -39,11 +39,14 @@ class CapTouchDemo(Application):
self
.
last_calib
=
None
self
.
state
=
0
self
.
timer
=
0
self
.
button
=
0
self
.
button
=
None
def
think
(
self
,
ins
:
InputState
,
delta_ms
:
int
)
->
None
:
super
().
think
(
ins
,
delta_ms
)
if
self
.
button
is
not
None
:
press_event
=
(
self
.
button
!=
ins
.
buttons
.
app
)
and
ins
.
buttons
.
app
else
:
press_event
=
False
self
.
button
=
int
(
ins
.
buttons
.
app
)
if
press_event
:
print
(
self
.
button
)
...
...
@@ -116,6 +119,10 @@ class CapTouchDemo(Application):
ctx
.
rgb
(
1.0
,
0.5
,
0.2
)
ctx
.
text
(
"
calibrating...
"
)
def
on_enter
(
self
,
vm
:
Optional
[
ViewManager
])
->
None
:
super
().
on_enter
(
vm
)
self
.
button
=
None
# For running with `mpremote run`:
if
__name__
==
"
__main__
"
:
...
...
This diff is collapsed.
Click to expand it.
python_payload/apps/demo_cap_touch/flow3r.toml
+
1
−
1
View file @
d3ac662c
...
...
@@ -3,7 +3,7 @@ name = "captouch demo"
category
=
"Apps"
[entry]
class
=
"
App
"
class
=
"
CapTouchDemo
"
[metadata]
author
=
"Flow3r Badge Authors"
...
...
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