mirror of
https://github.com/playfultechnology/esp32-eyes.git
synced 2025-12-06 17:15:42 -08:00
Added manual look and blink control
Added ability to override "random" look, blink, and behaviour change operation, so that look direction and blink can be set with, e.g. a joystick control.
This commit is contained in:
@@ -27,6 +27,7 @@ void LookAssistant::LookAt(float x, float y)
|
||||
float scaleY_x;
|
||||
float scaleY_y;
|
||||
|
||||
// What is this witchcraft...?!
|
||||
moveX_x = -25 * x;
|
||||
moveY_x = -3 * x;
|
||||
moveY_y = 20 * y;
|
||||
@@ -51,18 +52,14 @@ void LookAssistant::LookAt(float x, float y)
|
||||
_face.LeftEye.Transformation.Animation.Restart();
|
||||
}
|
||||
|
||||
void LookAssistant::Update()
|
||||
{
|
||||
void LookAssistant::Update() {
|
||||
Timer.Update();
|
||||
|
||||
if (Timer.IsExpired())
|
||||
{
|
||||
if (Timer.IsExpired()) {
|
||||
Timer.Reset();
|
||||
auto x = random(-50, 50);
|
||||
auto y = random(-50, 50);
|
||||
LookAt((float)x / 100, (float)y / 100);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user