Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
uni_ete_hepialight_mqtt
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
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
jonas.stirnema
uni_ete_hepialight_mqtt
Commits
5e26adcd
Commit
5e26adcd
authored
1 year ago
by
nicolas.albanesi
Browse files
Options
Downloads
Patches
Plain Diff
Added some stuff for esp com with hepialight
parent
cfcb6f29
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hepialight/main.py
+8
-0
8 additions, 0 deletions
hepialight/main.py
with
8 additions
and
0 deletions
hepialight/main.py
+
8
−
0
View file @
5e26adcd
id
=
[
0
,
0
]
matsize
=
[
0
,
0
]
esp_dir
=
0
# Display and images functions
...
...
@@ -107,6 +108,7 @@ def update_id(new_id):
# Handle the commands received via UART
def
handle_receive
(
msg
,
msg_bytes
,
d
):
global
esp_dir
print
(
"
Received from {} : {}
"
.
format
(
d
,
msg
))
...
...
@@ -140,6 +142,7 @@ def handle_receive(msg, msg_bytes, d):
x
,
y
=
msg
.
split
(
"
;
"
)[
-
1
].
split
(
"
,
"
)
print
(
"
Matsize : {} {}
"
.
format
(
x
,
y
))
matsize
=
[
int
(
x
),
int
(
y
)]
envoyer_msg
(
esp_dir
,
"
MATSIZE:{},{}
"
.
format
(
x
,
y
))
elif
msg
.
startswith
(
"
TEXT
"
):
msgs
=
msg
.
split
(
"
;
"
)
...
...
@@ -164,11 +167,16 @@ def handle_receive(msg, msg_bytes, d):
elif
msg
==
"
OK
"
:
update_id
(
id
)
esp_dir
=
d
# Main
afficher_texte
(
"
Ready
"
,
VERT
,
speed
=
0.01
)
# Try to find the ESP and start the initialisation
envoyer_msg
(
S
,
"
ESP
"
)
envoyer_msg
(
O
,
"
ESP
"
)
while
True
:
for
d
in
[
N
,
S
,
E
,
O
]:
...
...
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