Skip to content

Commit

Permalink
Added randomSeed to setup, and COMBINED hex file
Browse files Browse the repository at this point in the history
A customer, menehune23, commented on the product page about how the
first time you play after a power cycle the order of the sequence is
always the same. Adding a randomSeed in the setup (usuing A0 - before it
is setup with it's internal pullup) solved the issue. Now it is much
more random, and I doubt it will ever start with the same exact
sequence.

Also added the combined hex file that we are programming with in
production. This has been requested on other kits, so I thought I'd
throw it in this repo too.
  • Loading branch information
lewispg228 committed Apr 1, 2014
1 parent bb0ed49 commit a9e5554
Show file tree
Hide file tree
Showing 2 changed files with 2,056 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Firmware/Binary_Blaster/Binary_Blaster.ino
Expand Up @@ -121,6 +121,13 @@ void setup()
// aka the players "score" when they have completed the game.
Serial.begin(9600);

// Increase our odds of a truly random sequence generator
// Use an analogRead on a floating ADC pin (A0) to help the random()
// function to be more truly random. Without this, it seems that
// the first random order is always the same.
// Random function is used in suffle_sequence().
randomSeed(analogRead(A0));

// Button switches (INPUTS with pullups)
pinMode(button_input_pin_bit0, INPUT_PULLUP);
pinMode(button_input_pin_bit1, INPUT_PULLUP);
Expand Down

0 comments on commit a9e5554

Please sign in to comment.