Skip to content

Commit ac6f097

Browse files
committed
Fix: random eye movements broken. Remove obsolete include.
1 parent 8aeff83 commit ac6f097

3 files changed

Lines changed: 5 additions & 4 deletions

File tree

M4_Eyes/M4_Eyes.ino

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -477,8 +477,10 @@ void loop() {
477477
if(eyeInMotion) { // Currently moving?
478478
if(dt >= eyeMoveDuration) { // Time up? Destination reached.
479479
eyeInMotion = false; // Stop moving
480-
// eyeMoveDuration = random(10000, 3000000); // 0.01-3 sec stop
481-
// eyeMoveStartTime = t; // Save initial time of stop
480+
if (moveEyesRandomly) {
481+
eyeMoveDuration = random(10000, 3000000); // 0.01-3 sec stop
482+
eyeMoveStartTime = t; // Save initial time of stop
483+
}
482484
eyeX = eyeOldX = eyeNewX; // Save position
483485
eyeY = eyeOldY = eyeNewY;
484486
} else { // Move time's not yet fully elapsed -- interpolate position

M4_Eyes/globals.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
#include "Adafruit_Arcada.h"
44
#include "DMAbuddy.h" // DMA-bug-workaround class
5-
#include "HeatSensor.h"
65

76
#if defined(GLOBAL_VAR) // #defined in .ino file ONLY!
87
#define GLOBAL_INIT(X) = (X)

M4_Eyes/user_watch.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void user_loop(void) {
3434
// Estimate the focus position.
3535
heatSensor.find_focus();
3636

37-
// Set values for the new X and Y.
37+
// Set values for the new X and Y.
3838
eyeTargetX = heatSensor.x;
3939
eyeTargetY = -heatSensor.y;
4040
}

0 commit comments

Comments
 (0)