mirror of
https://github.com/DinoMalin/paranoia-1.0.git
synced 2026-09-23 04:16:56 +02:00
feat: modify face according to emotion
This commit is contained in:
@@ -49,3 +49,19 @@ data = json.loads(response.choices[0].message.content);
|
|||||||
print("res:", data["res"])
|
print("res:", data["res"])
|
||||||
print("emotion:", data["emotion"])
|
print("emotion:", data["emotion"])
|
||||||
print("score:", data["score"])
|
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()
|
||||||
|
|||||||
@@ -48,4 +48,9 @@ void loop() {
|
|||||||
face.drawLove();
|
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]");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user