feat: modify face according to emotion

This commit is contained in:
DinoMalin 2025-03-05 16:24:31 +01:00
parent 89867277c0
commit 9476f31986
2 changed files with 21 additions and 0 deletions

16
ai.py
View File

@ -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()

View File

@ -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]");
}