Skip to content

Commit bd0eef1

Browse files
Calibrate boop AFTER voice changer is running
1 parent aa8c55b commit bd0eef1

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

M4_Eyes/M4_Eyes.ino

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,6 @@ void setup() {
400400
calcDisplacement();
401401
Serial.printf("Free RAM: %d\n", availableRAM());
402402

403-
yield();
404-
if(boopPin >= 0) {
405-
boopThreshold = 0;
406-
for(i=0; i<240; i++) {
407-
boopThreshold += readBoop();
408-
}
409-
boopThreshold = boopThreshold * 110 / 100; // 10% overhead
410-
}
411-
412403
randomSeed(SysTick->VAL + analogRead(A2));
413404
eyeOldX = eyeNewX = eyeOldY = eyeNewY = mapRadius; // Start in center
414405
for(e=0; e<NUM_EYES; e++) { // For each eye...
@@ -432,6 +423,15 @@ void setup() {
432423
}
433424
#endif
434425

426+
yield();
427+
if(boopPin >= 0) {
428+
boopThreshold = 0;
429+
for(i=0; i<240; i++) {
430+
boopThreshold += readBoop();
431+
}
432+
boopThreshold = boopThreshold * 110 / 100; // 10% overhead
433+
}
434+
435435
user_setup();
436436

437437
lastLightReadTime = micros() + 2000000; // Delay initial light reading

0 commit comments

Comments
 (0)