diff --git a/ai.py b/ai.py index 3fc2796..ed46028 100644 --- a/ai.py +++ b/ai.py @@ -49,3 +49,19 @@ data = json.loads(response.choices[0].message.content); print("res:", data["res"]) print("emotion:", data["emotion"]) print("score:", data["score"]) + + +serial = open("/dev/ttyACM0", "a") + +if data["emotion"] == "Heureux": + serial.write("5") +if data["emotion"] == "Complice": + serial.write("2") +if data["emotion"] == "Basique": + serial.write("1") +elif data["emotion"] == "Mefiant": + serial.write("3") +elif data["emotion"] == "Colere": + serial.write("4") + +serial.close() diff --git a/sketch/sketch.ino b/sketch/sketch.ino index dbe3aa2..f396ced 100644 --- a/sketch/sketch.ino +++ b/sketch/sketch.ino @@ -48,4 +48,9 @@ void loop() { face.drawLove(); } } + + //Serial.print("[CMD]"); + //Serial.println("[firefox --new-window 'https://www.terre-plate.org/terre-plate-preuve-ultime/']"); + //Serial.print("[CMD]"); + //Serial.println("[pwd]"); }