You make a panda that copies your facial expressions from a camera of your smartphone or PC.
- obniz Board
- power supply for obniz
- Servo Motor x2
- smartphone or PC with camera
- paper and wire for decorations
How to make
First, create an animal face such as panda. And use two Servo Motors to create its mouth like the image below.
Second, make two holes at both ends of the mouth. Then, insert Servo Motors from the back and them to the wire.
Connect Servo Motors to an obniz Board like the table and the image below by referring to Servo Motor Library.
|0||[Servo Motor1] signal|
|1||[Servo Motor1] Vcc|
|2||[Servo Motor1] GND|
|9||[Servo Motor2] signal|
|10||[Servo Motor2] Vcc|
|11||[Servo Motor2] GND|
In the end, supply power to the obniz Board and run the program below. Let’s smile and sad to the camera on your PC or smartphone. The panda mimics you.
This program is using clmtrackr library to score smiling/sadness to move panda’s mouth.
Get the position of face parts, parameters, and estimated emotion value like below in drawLoop function.
let positions = tracker.getCurrentPosition(); let parameters = tracker.getCurrentParameters(); let emotion = classifier.meanPredict(parameters);
Before running the program, please adjust the angle of Servo Motors.