Skip to content

Commit 3c6652f

Browse files
committed
Theoretically, fix random seed
But, practically and unfortunately, don't... Theory was that, since OUTPUT_PIN makes its way to GND/LOW eventually, it isn't floating enough to provide different HIGH/LOW values. And that's why, when using batteries but surprisingly not when using the programmer for power, we always seemed to get the same first interval sequence. UP_PIN and DOWN_PIN seem better options, since they float before the internal pull-downs are set and assuming user isn't holding their buttons. However, changing to UP_PIN yielded identical behavior. Not only that, but straight up using LOW did too. So, IDK wussup, but theoretically-improved-but- practically-identical is better enough in my book. Committing with this lengthy message as proof of effort.
1 parent 6cf4436 commit 3c6652f

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

arduino/higher_lower/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#define CTRL_PIN 8
1313
#endif
1414

15-
#define SEED_PIN OUTPUT_PIN
15+
#define SEED_PIN UP_PIN
1616

1717
#define THEME_NOTE_LENGTH 180
1818

arduino/higher_lower/higher_lower.ino

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,10 @@ void reset() {
9797
}
9898

9999
void setup() {
100+
// NOTE: seed before setup, before input pins are pulled
100101
initRandomSeed();
101102
setupInterface();
103+
102104
setupSerial();
103105
reset();
104106
}

0 commit comments

Comments
 (0)