loansindi/Color-O-Tron — pull request #3 by Aceiks (2014-09-02 19:13:35+00:00)
Title: General Code Changes

Hi~
Saw your post on Reddit and have been looking for something like this to work on, so thought I'd put in some time to see if you thought it helped the game. Unfortunately, I don't have the hardware to build the game for myself yet, but I do have an extensive background in micro-controller programming, so hopefully the code is fairly decent. But do test it out before you throw it into the final revision.

Didn't do too much to the code, mainly added some constants to improve maintainability. Added a win condition, which you can obviously make whatever animation for. Also added a timeout for if the user is "too slow", like in the Sorry game. You also don't need to check the entire input array after each round, just the newest user input so I changed that which will be slightly more efficient.

If you do decide you want to randomly seed with an unconnected ADC input, you can actually multiplex all the switches onto one ADC channel if you would like. See:
https://www.google.com/search?q=multiple+switches+one+adc

for more information.

Hopefully you find these commits helpful, let me know if you have any questions or suggestions.

Thanks,
Tim