Skip to content

Commit aa023c1

Browse files
committed
Tweaks to eagle eyes.
Improved configuration documentation of eagle eyes. Minor updates to debugging output.
1 parent 97fcaa2 commit aa023c1

File tree

3 files changed

+35
-18
lines changed

3 files changed

+35
-18
lines changed

M4_Eyes/M4_Eyes.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,7 @@ void eyesWide() {
169169

170170
// Force the eyes to a position on the screen.
171171
void eyesToCorner(float x, float y, bool immediate) {
172+
// Serial.println("eyesToCorner(" + String(x) + ", " + String(-y) + ", " + (immediate ? "TRUE" : "FALSE") + ")");
172173
moveEyesRandomly = false;
173174
eyeTargetX = x;
174175
eyeTargetY = y;

M4_Eyes/eyes/eagle/config.eye

Lines changed: 33 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,41 @@
11
{
2-
"boopThreshold" : 17500, // lower = more sensitive
3-
"eyeRadius" : 125,
4-
"irisRadius" : 110,
5-
"eyelidIndex" : "0x00", // From table: learn.adafruit.com/assets/61921
6-
"pupilColor" : [ 0, 0, 0 ],
7-
"lightSensor" : 102,
8-
"pupilMin" : 0.05,
9-
"pupilMax" : 0.25,
10-
"backColor" : [ 140, 40, 20 ],
11-
"irisTexture" : "eagle/iris.bmp",
12-
"scleraTexture" : "eagle/sclera.bmp",
13-
"upperEyelid" : "eagle/upper.bmp",
14-
"lowerEyelid" : "eagle/lower.bmp",
15-
"tracking" : true,
16-
"squint" : 0.0,
2+
"boopThreshold" : 17500, // lower is more sensitive
3+
"eyeRadius" : 125, // radius, in pixels
4+
"irisRadius" : 120, // radius, in pixels
5+
"slitPupilRadius" : 0, // height, in pixels; 0 is round pupil
6+
7+
"irisTexture" : "eagle/iris.bmp",
8+
// "scleraTexture" : "eagle/sclera.bmp",
9+
"scleraColor" : [ 64, 24, 22 ],
10+
"pupilColor" : [ 0, 0, 0 ],
11+
"backColor" : [ 140, 40, 20 ], // covers the outermost/backmost part of the eye where the sclera texture map (or color) doesn’t reach
12+
"eyelidIndex" : "0x00", // 8-bit value; from table learn.adafruit.com/assets/61921
13+
14+
// independent irisTexture, scleraTexture, irisColor, scleraColor,
15+
// pupilColor, backColor, irisAngle, scleraAngle, irisSpin, scleraSpin,
16+
// irisMirror, scleraMirror, and rotate can be specified
1717
"left" : {
1818
},
1919
"right" : {
2020
},
21+
22+
"upperEyelid" : "eagle/upper.bmp",
23+
"lowerEyelid" : "eagle/lower.bmp",
24+
"tracking" : true,
25+
"squint" : 0.5, // offsets eyelid center point vertically
26+
27+
"lightSensor" : 102, // light sensor pin; 102 is MONSTER M4SK, 21 is HalloWing M4
28+
"pupilMin" : 0.05, // smallest pupil size as a fraction of iris size; from 0.0 to 1.0
29+
"pupilMax" : 0.3, // largest pupil size as a fraction of iris size; from 0.0 to 1.0
30+
2131
"voice" : false,
2232
"pitch" : 1.0,
23-
"gain" : 1.0
33+
"gain" : 1.0, // microphone gain (sensitivity)
34+
// "waveform" : "sine" // "square", "sine", "tri" and "saw" are supported
35+
// "modulate" : 30 // waveform modulation, in Hz
36+
37+
"wiichuck" : {
38+
"min" : 28,
39+
"max" : 229
40+
}
2441
}

M4_Eyes/user_wiichuck.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -178,17 +178,16 @@ void user_loop(void) {
178178

179179
int joyX = nunchuck1.getJoyX();
180180
int joyY = nunchuck1.getJoyY();
181+
// Serial.println("joyXY(" + String(joyX) + ", " + String(joyY) + ")");
181182
float x = map2(joyX, low, high, -1.0, 1.0);
182183
float y = map2(joyY, low, high, -1.0, 1.0);
183184
int cornerX = (joyX - low) / divFactor;
184185
int cornerY = (joyY - low) / divFactor;
185186
int chaseColor = 0;
186-
// Serial.println("cornerXY=" + String(cornerX) + "," + String(cornerY));
187187
if(cornerX == 1 && cornerY == 1) { // return to normal when the joystick is in the middle
188188
eyesNormal();
189189
neoPixelState = LUMINESCENT;
190190
} else {
191-
// Serial.println("eyesToCorner(" + String(x) + "," + String(-y) + ")");
192191
eyesToCorner(x, -y, true);
193192
if(cornerX < 1) {
194193
chaseColor = green;

0 commit comments

Comments
 (0)