Skip to content
Snippets Groups Projects
Commit 5e26adcd authored by nicolas.albanesi's avatar nicolas.albanesi
Browse files

Added some stuff for esp com with hepialight

parent cfcb6f29
No related branches found
No related tags found
No related merge requests found
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]:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment