[!NOTE]
This repository was forked from stack-chan/m5stack-avatar. It is not planned to be pulled to the original repository because the original is frozen. The development of this repository is progressing to improve & focus on facial functions.
M5Stack-Avatar


Video: https://www.youtube.com/watch?v=C1Hj9kfY5qc
日本語
Features
- :neutral_face: Draw avatar face
- :smile: Expression(Happy, Angry, Sad etc.)
- :smiley_cat: Customize face
- :kiss: Lip sync
- :art: Color Palette
- :arrows_clockwise: Move, Zoom and Rotation
- :two: Compatible with M5Stack Core2
Installation
Prerequisites
Using Arduino IDE
- On Arduino IDE, Select "Sketch > Include Library > Manage Libraries..."
- Search "m5stack avatar"
- Select "M5Stack_Avatar" from the results then click "Install"
- The library gets installed
Using Platform IO
- Initialize your Platform IO project
mkdir my-avatar
cd my-avatar
platformio init -d . -b m5stack-core-esp32
- Install the library and its dependency
platformio lib install M5Unified
platformio lib install M5Stack-Avatar
- The library gets downloaded from repository to .piolibdeps directory
Usage
#include <M5Unified.h>
#include <Avatar.h>
using namespace m5avatar;
void setup()
{
M5.begin();
avatar.init();
}
void loop()
{
}
Using LipSync
- setup AquesTalk-ESP32 (http://blog-yama.a-quest.com/?eid=970195).
- (For parsing Kainji statement) Copy the dictionary file from above link to the microSD card.
- You don't need to copy AquesTalkTTS files. They are included in this library.
- Write below to open avatar mouth according to the audio output.
#include <AquesTalkTTS.h>
#include <M5Unified.h>
#include <Avatar.h>
#include <tasks/LipSync.h>
using namespace m5avatar;
const char* AQUESTALK_KEY = "XXXX-XXXX-XXXX-XXXX";
void setup() {
int iret;
M5.begin();
iret = TTS.create(AQUESTALK_KEY);
avatar.init();
avatar.addTask(lipSync, "lipSync");
}
void loop() {
M5.update();
if (M5.BtnA.wasPressed()) {
TTS.play("konnichiwa", 80);
}
}
Further usage
see examples
directory.
Migration from 0.7.x to 0.8.x
M5Stack-Avatar
now depends on M5Unified
, the integrated library for all devices of M5Stack series. Since 0.8.0, Sketches with avatar should include M5Unified.h
instead of M5Stack.h
or M5Core2.h
Notes for v0.10.0
Some applications may reboot due to insufficient stack size for other tasks. In such cases, increase the stack size of the relevant task.