Skip to content

Commit d5f3b29

Browse files
committed
Fix eyesWide() function only opening one eye.
1 parent fec4273 commit d5f3b29

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

M4_Eyes/M4_Eyes.ino

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -135,10 +135,10 @@ uint32_t availableRAM(void) {
135135

136136
// USER CALLABLE FUNCTIONS
137137

138-
// Set the booped flag.
139-
void eyesWide(bool t) {
138+
// Force the booped flag to be set true.
139+
void eyesWide() {
140140
// Serial.println("eyesWide()");
141-
booped = t;
141+
boopSum = 99999;
142142
}
143143

144144
// Start a blink.

M4_Eyes/globals.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -242,8 +242,8 @@ extern void user_setup(void);
242242
extern void user_setup(StaticJsonDocument<2048> &doc);
243243
extern void user_loop(void);
244244

245-
// user callable functions
246-
extern void eyesWide(bool);
245+
// User callable functions in M4_Eyes.ino
246+
extern void eyesWide();
247247
extern void eyesBlink();
248248
extern void eyesToCorner(float x, float y, bool immediate);
249249
extern void eyesNormal();

M4_Eyes/user_wiichuck.cpp

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,6 @@ void user_loop(void) {
190190
int chaseColor = 0;
191191
// Serial.println("cornerXY=" + String(cornerX) + "," + String(cornerY));
192192
if(cornerX == 1 && cornerY == 1) { // return to normal when the joystick is in the middle
193-
// Serial.println("eyesNormal()");
194193
eyesNormal();
195194
neoPixelState = LUMINESCENT;
196195
} else {
@@ -212,20 +211,22 @@ void user_loop(void) {
212211
}
213212

214213
bool buttonC = nunchuck1.getButtonC();
215-
eyesWide(buttonC);
216214
bool buttonZ = nunchuck1.getButtonZ();
217-
if(buttonZ) {
218-
Serial.println("buttonZ");
219-
eyesBlink();
220-
}
221215

222216
if(buttonC && buttonZ) {
223-
Serial.println("buttonC & buttonZ");
224-
chaseColor = red;
225-
if(neoPixelState == LUMINESCENT) neoPixelState = CHASE_UP;
226-
} else if(buttonC) {
227-
Serial.println("buttonC");
228-
neoPixelState = SPARKLE;
217+
Serial.println("buttonC & buttonZ");
218+
chaseColor = red;
219+
if(neoPixelState == LUMINESCENT)
220+
neoPixelState = CHASE_UP;
221+
} else {
222+
if(buttonC) {
223+
Serial.println("buttonC");
224+
eyesWide();
225+
neoPixelState = SPARKLE;
226+
} else if(buttonZ) {
227+
Serial.println("buttonZ");
228+
eyesBlink();
229+
}
229230
}
230231

231232
if(strip.numPixels() > 0) {

0 commit comments

Comments
 (0)