- 😐 Draw avatar face
- 😄 Expression(Happy, Angry, Sad etc.)
- 😺 Customize face
- 💋 Lip sync
- 🎨 Color Palette
- 🔃 Move, Zoom and Rotation
- 2️⃣ Compatible with M5Stack Core2
- Output to Composite Video Signal(CVBS)
- USB Driver is installed throwgh Getting Started: Installing the USB Driver
- Any of IDE is set up
- This library is confirmed on Arduino IDE and Platform IO for now
- 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
- 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-lgfx-cvbs
- The library gets downloaded from repository to .piolibdeps directory
#include <M5GFX.h>
#include <LGFX_8BIT_CVBS.h>
#include <Avatar.h>
using namespace m5avatar;
static LGFX_8BIT_CVBS display;
static M5Canvas sp_avatar(&display);
Avatar avatar(&sp_avatar);
void setup()
{
M5.begin();
display.init();
display.setPivot((display.width() >> 1), display.height() >> 1);
avatar.init(1); // start drawing
avatar.setScale(1.0);
avatar.setRotation(0);
avatar.setSpeechFont(&fonts::Font0);
avatar.setSpeechText("Hello World!");
avatar.setExpression(Expression::Happy);
}
void loop()
{
// avatar's face updates in another thread
// so no need to loop-by-loop rendering
}
see examples
directory.