mirror of
https://github.com/DinoMalin/paranoia-1.0.git
synced 2025-10-30 11:06:00 +00:00
feat: modify face according to emotion
This commit is contained in:
parent
89867277c0
commit
9476f31986
16
ai.py
16
ai.py
@ -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]");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user